Introduction
Every programming language deals with some data. For example to print any message it requires charter or string type of data. To solve any mathematics expression it requires integral as well as real number (floating type) of data. C is very rich in data type. We can broadly divide all data type in C in three categories :
- Primitive or fundamental data type
- Derived data type
- User defined data type
Built-in data types or primitive data types :
- int
- float
- double
- char
- void
int - data type
int is used to define integer numbers.
{
int count;
Count = 5;
}
float - data type
float is used to define floating point numbers.
{
float Miles;
Miles = 4.6;
}
double - data type
double is used to define BIG floating point numbers.
It reserves twice the storage for the number. On PCs this is likely to be 8 bytes;
{
double Atoms;
Atoms = 25000000;
}
char - data type
char defines characters.
{
char Letter;
Letter = 'a';
}
Derived data types available are
- array
- pointers
- functions
User defined data types
- structure
- union
- enumerations
Derived data types and User defined data types will be explained in next sessions.
0 comments:
Post a Comment