Introduction to C#
- slide 7 : 43
Simple types
Most simple types in C# are similar to the simple types in C
Major differences:
All simple C# types have fixed bit sizes
C# has a boolean type called
bool
C# chars are 16 bit long
In C# there is a high-precision 128 bit numeric fixed-point type called
decimal
Pointers are not supported in the normal parts of a C# program
In the unsafe part C# allows for pointers like in C
All simple types are in reality structs in C#, and therefore they have members
Demonstrations of the simple type bool in C#.
Demonstrations of the simple type char in C#.
Demonstrations of numeric types in C#.
Output from the numeric demo program.
Exploring the type Char
Hexadecimal numbers
The struct System.Char
Decimal Floating Point in .NET
The struct System.Sbyte
The struct System.Byte
The struct System.Int16
The struct System.UInt16
The struct System.Int32
The struct System.UInt32
The struct System.Int64
The struct System.UInt64
The struct System.Single
The struct System.Double
The struct System.Decimal