I have the following:
int num=500;
char text[8];
how do I make it so that text ends up being the hex 0x500, or 1280?
edit: i see that its pretty simple to make it text, like in some of the answers. But I need this text to be interpreted as a hex by C. So in reality it should be an unsigned hex int.
This should do it.
This is assuming you on purposely didn’t convert
numto hexadecimal, if this wasn’t on purpose this createstextwith the integer converted to hexadecimal: