3/06/2014

(C, C++) int to char *, char * to int, _itoa_s and atoi functions

char *s="100";
int a = atoi(s);
printf("%d\n", a);

char s2[30];
a=211;
_itoa_s(a, s2, 10); //in here, 10 is Decimal, 2 is Binary.
printf("%s\n", s2);

No comments:

Post a Comment