Literals : Data Type « Data Type « C# / CSharp Tutorial
- C# / CSharp Tutorial
- Data Type
- Data Type
literals refer to fixed values that are represented in their human-readable form.
- To specify a long literal, append an l or an L. For example, 12 is an int, but 12L is a long.
- To specify an unsigned integer value, append a u or U. Thus, 100 is an int, but 100U is a uint.
- To specify an unsigned, long integer, use ul or UL. For example, 984375UL is of type ulong.
- To specify a float literal, append an F or f to the constant. For example, 10.19F is of type float.
- To specify a decimal literal, follow its value with an m or M. For example, 9.95M is a decimal literal.
- A hexadecimal literal must begin with 0x (a zero followed by an x).