This is just something I wanted to do for fun, no real practical use of it.
Say for example I enter 0xDEADAAAA
I want to be able to transform the value into 0xDDEAAAAA
Meaning the 4 most significant bytes shift over one byte. And the 4th most significant byte now becomes the first most significant byte.
Kind of like a circular shift of the first 4 bytes.
For now I'm doing
value = value >> ((sizeof(unsigned int) * 8) / 2); This will shift all bytes over one byte. But how would I do the circular roll of the 4th most significant byte into the MSB?
0xDEAD0123or something else with distinct bytes in the low-order part of the value. Also, you seem to be mixing up bytes with nybbles; each hex digit is a nybble (aka nibble), and it appears you want to deal with the 4 most significant nybbles, not bytes.