Beruflich Dokumente
Kultur Dokumente
Uses
• Identify the type of a variable when it declared.
• Identify the type of the return value of a function.
• Identify the type of a parameter expected by a function.
Why Data Types?
1.Every variable must have a type
1. Integer 1. Structure
2. Real 1. Arrays 2. Union
3. Character 2. Pointers 3. Enumeration
4. Void 4. Typedef
A. Primary Data Types
These are fundamental or basic data types in C namely
1. Integer
2. Real
3. Character
4. void
1. Integer Data type
Integers are used to store whole numbers
For example –
1. void main()
2. void main(void)
B. Derived Data Types
Derived data types are nothing but primary data types –
1. Arrays
2. Pointers
1. Array Data Type
An array is a collection of items stored at continuous memory
locations.
output - 1
4. Typedef Data Type
You can define explicitly new data type names by using the
keyword typedef. Using typedef does not actually create a new
data class, rather it defines a name for an existing type.
void main()
{
typedef int suman;
suman a,b; //a and b are of int data type
-----
}
Now, suman will act as int data type.
Thank You