Possible Duplicate:
Assuming 32bit ints
So I read somewhere that int equals int32 in c#. Is it true also on 64-bit machines? Should I use int32 just to make sure no one at microsoft decides to change the size of int?
1. Int16 is used to represents 16-bit signed integers. Int32 is used to represents 32-bit signed integers . Int64 is used to represents 64-bit signed integers.
The types int8 , int16 , int32 , and int64 (and their unsigned counterparts) are best suited for data. An int64 is the typical choice when memory isn't an issue.
Int32 is 32 bit, while int is 64 bit; int is 32 bit integer on 32 bit platform, while it is 64 bit on 64 bit platform; int is value type, while System.
Int32 is a type provided by . NET framework whereas int is an alias for Int32 in C# language.
int
is an alias for Int32
long
is an alias for Int64
Their sizes will not change, at all, just use whichever one you need to use.
The use of them in your code is in no way related to 32bit and 64bit machines
EDIT: In reference to the comments about Thread Safety. Here is a good question and answers that detail any issues you need to be aware of. Under C# is Int64 use on a 32 bit processor dangerous
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With