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 running managed code?
C# – sizeof(int) on x64
64-bitc++clrsizeof
Related Question
- Python – How to determine the size of an object in Python
- C# – Get int value from enum in C#
- C# – How to remedy “The breakpoint will not currently be hit. No symbols have been loaded for this document.” warning
- C# – Interop type cannot be embedded
- C# – How to generate a random int number
- C# – reason for C#’s reuse of the variable in a foreach
- C# – Try-catch speeding up the code
- C# – Why not inherit from List
Best Solution
The keyword
int
aliasesSystem.Int32
which still requires 4 bytes, even on a 64-bit machine.