Reputation: 21
I'm working on a strange little embedded platform that seems to have undefined behavior when calling their POSIX-compliance functions with source pointers that are anything other than a char*. It's kind of a stupid workaround, but how would I go about converting an int in C to a character buffer with the same bit ordering?
For example:
int foo = 15;
turning into
char* bar = "\x00\x0F\x00\x00";
Upvotes: 2
Views: 114