I want to convert int to char array and double to char array. Any way of doing this in C or Objective C.
2 Answers
If you want to treat the number as an array of char, you can take the address and cast the pointer:
int i;
double d;
char * ic = (char *) &i;
char * dc = (char *) &d;
then ic and dc are pointers to char. They aren't zero-terminated, so you can't use them as strings, but they can be used as arrays.
snprintf, or do you mean something else?