Hi. I have an integer (4 bytes, no more, no less) which I need to copy into an unsigned character array. There has to be some simple way to do it, and if you know it, please reply. The way I'm doing it at the moment is sprintf'ing the integer to a string as a hexadecimal number, converting every two (text) bytes into an integral byte and placing it into the array. Very inefficient, and it is imperative I find a better way of doing it :<
Thanks.
Copying Integers to Character Array (In C)
Moderator: General Moderators
-
TS_Death_Angel
- Forum Commoner
- Posts: 31
- Joined: Sat Dec 31, 2005 8:49 am