Search This Blog

Wednesday, November 6, 2013

int keyword C#

C# > Types > int

The int keyword is an integral type.
Range: -2,147,483,648 to 2,147,483,647
Size: Signed 32-bit integer

Example:

int i = 100;

int x = 3.0; // Error 1 Cannot implicitly convert type 'double' to 'int'. An explicit conversion exists (are you missing a cast?)

int y = (int)3.0; // OK: explicit conversion.