Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.
Revision as of 08:29, 19 August 2025 by Dylan (talk | contribs) (add: size)

The int class in C Sharp is a data type which can store positive and negative whole numbers in variables.

See Integer for generic information about what integers can represent and how they are represented in memory.

Size

A long in C# is represented by 4 bytes, or 32 bits.

This means it can store integral values from -2,147,483,648 to 2,147,483,647.

For integers that don't fit this range, you can use the C Sharp long data type instead.

Example

int a;
int b = 74;
int c = (int)15.2; // 15