Showing posts with label What is the difference between int. Show all posts
Showing posts with label What is the difference between int. Show all posts

Friday, 18 July 2014

What is the difference between int, int16, Int32 and int64 in C#.

 int Vs int16 Vs Int32 Vs int64 in c#


int
Int16

Int32

Int64

1> It is a primitive data type defined in C#.

It is a FCL type.

It is a FCL type.

It is a FCL type.

2> It is mapped to Int32 of FCL type.

In C#, short is mapped to Int16.

In C#, int is mapped to Int32.

In C#, long is mapped to Int64.

3> It is a value type and represent System.Int32 struct.

It is a value type and represent System.Int16 struct.

It is a value type and represent System.Int32 struct.

It is a value type and represent System.Int64 struct.

4> It is signed and takes 32 bits.

It is signed and takes 16 bits.

It is signed and takes 32 bits.

It is signed and takes 64 bits.

5> It has minimum -2147483648 and maximum +2147483647 capacity.

It has minimum -32768 and maximum +32767 capacity.

It has minimum -2147483648 and maximum +2147483647 capacity.

It has minimum –9,223,372,036,854,775,808 and maximum 9,223,372,036,854,775,807 capacity.