When I do sizeof(int)
in my C#.NET project I get a return value of 4. I set the project type to x64, so why does it say 4 instead of 8? Is this because I\'m r
You may be thinking of an int
pointer or System.IntPtr
. This would be 8 bytes on an x64 and 4 bytes on an x86. The size of a pointer shows that you have 64-bit addresses for your memory. (System.IntPtr.Size
== 8 on x64)
The meaning of int
is still 4 bytes whether you are on an x86 or an x64. That is to say that an int
will always correspond to System.Int32
.