Skip to main content

Posts

Showing posts with the label sizeof(int)

sizeof(int) Golu (ಗೋಳು )

THis is what I should have named my blog. Whatever I attempt is always messed up. :-( I tried as simple thing as finding the size of integer in c++ compiler. It just said 4 bytes. I was sure it will say, 8 bytes because Intel core@ processor is 64 bit processor. VC++ 6 said 4 bytes. OK old compiler. May be it does not have 64 bit support. Downloaded VC++ 2008 express edition. It took me SOME time to figure out how to compile program there. Then A great disappointment. Still 4 bytes. I tried google in vain to see how to set 64 bit support. Left it. OK. Linux is always better. I was confident my Linux C++ compiler will give me 8 bytes. Again a disappointment . The answer was 444(sizeof(int),sizeof(long),sizeof(p) - p in int *). Posted a question regarding this in Linux forums. Funny thing is /usr/include/bits/wordsize.h defines __WORDSIZE as 32. Now where does sizeof(int) come into picture ? I was supposed to read perl? Ok moms are meant to be multitasking. The p...