typedef statement
It is used to redefine the name of an existing variable type.
typedef long int NUMBER
now we can declare variables of the type long int by writing-
NUMBER num1,num2;
typedef provide a short and meaningful way to call a data type. Usually, uppercase letters are used to make it clear that we are dealing with a renamed data type.
struct employee
{
char name[20];
int age;
};
typedef struct employee EMP;
EMP e1,e2;
typedef statement provides a short and meaningful way to call a data type. Its purpose is to redefine the name of an existing variable type. Typedef may be used with any data type. Its general format is as follows :
Syntax :
typedef <existing datatype> <new datatype>;
Example :
typedef int itech;
itech a,b,c; /* declare a, b,c as int variable */