Data Type:- Data type is used to define a variable in a program(before it is used). C has 4 type of 'data type' namely- 1)Primar...
Data Type:-Data type is used to define a variable in a program(before it is used).
C has 4 type of 'data type' namely-
1)Primary Data type.
2)Secondary Data type.
3)User defined Data type.
4)Empty Data type.
1)Primary Data Type:-Primary data type also called as basic data type and built in data type.Some primary data type are-int,char,float,long etc.
2)Derived Data type:-The definition of derived data type is quite simple "those data type which are derived from the primary data type are called Derived Data type"
Example-union,array,structure,pointer,enum etc.
3)User-Defined Data type:-Those data-type which are defined by users.
Example:- typedef<basic data type><new data type>
Like:-typedef float fl;
4)Empty Data type:-Empty data types are those data types which return null value.
Example:-Void.
C has 4 type of 'data type' namely-
1)Primary Data type.
2)Secondary Data type.
3)User defined Data type.
4)Empty Data type.
1)Primary Data Type:-Primary data type also called as basic data type and built in data type.Some primary data type are-int,char,float,long etc.
Data type | Range | bytes | Format String |
---|---|---|---|
int | -32768 to +32767 | 2 | %d |
char | -128 to +127 | 1 | %c |
Float | -3.4e38 to +3.4e38 | 4 | %f |
unsigned int | 0 to +65535 | 2 | %u |
unsigned char | 0 to +255 | 1 | %c |
long int | -214783648 to +214783647 | 4 | %ld |
long unsigned int | 0 to +4294967295 | 4 | %lu |
double | -1.7e308 to +1.7e308 | 8 | %lf |
long double | -1.7e4932 to +1.7e4932 | 10 | %LF |
2)Derived Data type:-The definition of derived data type is quite simple "those data type which are derived from the primary data type are called Derived Data type"
Example-union,array,structure,pointer,enum etc.
3)User-Defined Data type:-Those data-type which are defined by users.
Example:- typedef<basic data type><new data type>
Like:-typedef float fl;
4)Empty Data type:-Empty data types are those data types which return null value.
Example:-Void.
If you have any query then leave your comments and don't forgot to follow me on Google+,Facebook,Twitter.
COMMENTS