I'm trying to convert an int
to a char*
. I'm on a Mac OS X so I can't use itoa
, since it's non-standard, I'm trying to use sprintf
or snprintf
but I keep on getting segmentation fault: 11
.
Here's what I've got:
snprintf(msg, sizeof(char *), "%d", 1);
So I'm hoping for a suggestion, what can I do?