The given function ( i believe ) will return the specified byte of a given type. I have been using this to identify endian-ness, but I was wondering if there is a way to make this work on temporary.Code:const int GetByte(void* i, unsignedchar byte) { return(int)((&i)[byte]); }
Such as
Code:GetByte("A",0);
will show the address, not the actual byte value
Although
works as expected.Code:GetByte(1,0);
I am sure I am just blindly over-looking some simple logic, but I thought I would ask.
Thank you sincerely.