Is an int a 64-bit integer in 64-bit C#?

Guy picture Guy · Oct 2, 2008 · Viewed 10.6k times · Source

In my C# source code I may have declared integers as:

int i = 5;

or

Int32 i = 5;

In the currently prevalent 32-bit world they are equivalent. However, as we move into a 64-bit world, am I correct in saying that the following will become the same?

int i = 5;
Int64 i = 5;

Answer

Jon Skeet picture Jon Skeet · Oct 2, 2008

No. The C# specification rigidly defines that int is an alias for System.Int32 with exactly 32 bits. Changing this would be a major breaking change.