Before we write program which can process user input , We must teach computer to
- Classify the given input (i.e whether it is user name or age)
- Store them in memory for later use.
We will focus on Classification in this chapter and Store in next chapter.
Make Computer Understand WorldData types in C Language
Data types specify what type of data we enter. C language has some predefined set of data types to handle various kinds of data that we can use in our program. These data types have different storage capacities.
Q) Can we create own data type ?
C language supports 2 different type of data types:
Primary data types
These are fundamental data types in C namely integer(int), floating point(float), character(char) and void.
Integer type (int)
Integers are used to store whole numbers.
Floating point type (float)
Floating types are used to store real numbers.
Character type (char)
Character types are used to store characters value
void type means no value. This is usually used to specify the type of functions which returns nothing.
Derived data types
Derived data types are nothing but primary data types but a little twisted or grouped together like array, structure, union and pointer. These are discussed in details later.