Data Types -
Data types are mean to identify the type of data associate of operations for handling. It is the type of the value that a variable can store in the memory is called data type.
1. Primitive Data type
2. User data type
3. Derived data type
1. Primitive data type -
These are classified as
Int
Char
Float
Double
Void
Int - It is a keyword while is used to define int number both positive and negative numbers can be store in the memory.
Example - int a=10;
Float - It is use to define floating point number. It is also called real number. This data type both positive and negative floating point number can be store in the memory.
Example - float a=5.6;
Char- It is a keyword while is used to define char can be store character in the memory.
Example - char= 'L';
Double - It is used to define store floating point number with double precision.
Void - it is the empty data type it is normally used in functions to indicate that the function does not return any value since no value is associated with this data type. It does not a copy any space in the memory. It is not associate with any variables expect pointer.
2. User define data type -
A special data type that is defined by user from the drived is called user define data type.
Example - structure, union, class etc
3. Derived data type -
Derived data types are built from the fundamental or basic data type.
Example - array, function,pointer etc.
No comments:
Post a Comment