I have some C code that I'd like to port to java. I haven't done much C coding, but I was able to follow along up until this one function. If anyone could help me understand what is going on, it would be greatly appreciated.
int reverse_integer(int input) {
int output = 0, i;
for ( i=0, i<sizeof(int); i++ ) {
output = ( input & 0x000000FF ) | output;
input >>= 8;
if ( i < 3 ) {
output <<= 8;
}
}
return output;
}
The function is used as such:
char * position = //some data
/*the included comment on this next line states its the size of a string*/
int i = reverse_integer( *(int*)position )