This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

-sizeof()


Hello, I am not a C++ guru, but this thing looks weird.
I have following two codes:

__int64 a = -4;
printf ("%016I64x\n", a); // prints fffffffffffffffc

__int64 b = -sizeof(int);
printf ("%016I64x\n", b); // prints 00000000fffffffc

Correct me if I am wrong, but shouldn't they return the same value (the first one)??
I thought that sizeof is evaluated before converting to __int64 (long long)...


... MinGW 3.4.2, Win XP 32-bit ...

---
Jan Ringoš, Tringi@Mx-3.cz
http://Tringi.Mx-3.cz

senior programmer-analyst
n.v.t. MX-3, www.mx-3.cz



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]