This is what I call a ‘address’ in a game I play: 0037F1C8
What I am trying to achieve in vc++ is convert that ‘address’ into this result: C8 F1 37 00
If you noticed, that result is the ‘address’, but spit out right to left for the final result of being left to right.
The result is what I then input into a packet I created and then sent to the server of a game.
I need code that will do this in vc++ as I have no clue on how to flip it and space it out like that.
You are not explaining what form you want your result in. Are you trying to get an ASCII string with this content?
In any case, the obvious way to put these into a string is by
The format string you are looking for would be something like:
"%2X %2X %2X %2X"An appropriate mask to give you only the lowest byte of an int “i” would be something like
i & 0xffUnder the circumstances, I’d just declare four ints to put the individual bytes into rather than doing something fancy — it likely wouldn’t be worth it.