1 Data types in c++
2 Built-in User Defined Derived
3 ---------- ----------- ------------
4 void, int, structure, array,
5 char, float, union, function,
6 double, bool, enum, pointer,
7 long long class, reference
8 Wide Character typedef
1Long
2Data Type Size (in bytes) Range
3long int 4 -2,147,483,648 to 2,147,483,647
4unsigned long int 4 0 to 4,294,967,295
5long long int 8 -(2^63) to (2^63)-1
6unsigned long long int 8 0 to 18,446,744,073,709,551,615
1Data Type Size
2int (Integer) = 5, 6, 7 2
3float (Floating Value) = -3.67, 2.67 4
4double (Double of float) = -7.8746 8
5char (Character) = 'a', 'b', 'A' 1
6string (Multiple chars) = "Hello World" No of Chars
7bool (Boolean) = true, false true = 1, false = 0
1int myNum = 5; // Integer (whole number)
2float myFloatNum = 5.99; // Floating point number
3double myDoubleNum = 9.98; // Floating point number
4char myLetter = 'D'; // Character
5bool myBoolean = true; // Boolean
6string myText = "Hello"; // String