Data types tell about the type of data a variable can hold. Whenever a variable is declared, it occupies some computer memory with space as required by the particular datatype.
Datatype size varies on the system architechture.
For example, int variable occupies 2bytes on some systems and 4 bytes on Unix systems.
Data types in C++ is mainly divided into two types:
- Primitive data types
- Abstract or User defined data types
Primitive data tyeps :
|DATA TYPE||Size (byte)||EXPLANATION|
|double||4||BIg decimal number|
|pointer( int*, char*)||2||Stores the address of variable|
Abstract or Use defined data types:
User defined data types stores multiple values either of same type or different type or both.