int in=0xeef01f88;
int * ipoi=∈
char*cpoi=(char*)ipoi;
cout<<std::hex<<(int)*ipoi<<" "<<(int)*(cpoi)<<" "<<(int)*(cpoi+1)<<" "<<(int)*(cpoi+2)<<endl;
When I compile this on Cxxdroid (Android compiler) it works perfectly as it should so cout from char pointers gives values of separate bytes like:
eef01f88 88 1f f0.
Another way when I compile the same code on Windows using GNU GCC COMPILER I got this output:
eef01f88 ffffff88 1f fffffff0.
How is it possible? Why the first and third char pointer values has ffffff in themselves? There even aren't any ff values around *(cpoi+1)
. (f0)
Will changing compiler fix the problem?
I am using Code Blocks. It has plenty of compiling options but I already tried every standard available (up to 2011 ISO C language standard). What am I missing?