Value type - ushort uint ulong unsigned 16 bit 32 bit 64 bit integers

suggest change
// assigning an unsigned short to its minimum value
ushort s = 0;

// assigning an unsigned short to its maximum value
ushort s = 65535;

// assigning an unsigned int to its minimum value
uint i = 0;

// assigning an unsigned int to its maximum value
uint i = 4294967295;

// assigning an unsigned long to its minimum value (note the unsigned long postfix)
ulong l = 0UL;

// assigning an unsigned long to its maximum value (note the unsigned long postfix)
ulong l = 18446744073709551615UL;

It is also possible to make these types nullable, meaning that, in addition to the usual values, null can be assigned, too. If a field of a nullable type is not initialized, it is null instead of 0. A local must be assigned before it is read. Nullable types are marked by adding a question mark (?) after the type.

uint a;  // A local is unassigned. A field of this type defaults to 0.
uint? b; // A local is unassigned. A field of this type defaults to null.

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents