Table of Contents
show
Typedef Storage Class
Typedef storage class specifier is used for syntactic convenience only. Typedef is used for creating a synonym or an alias for a known type
syntax
typedef known_data_type alias_name;
Where known_data_type is a generic term and can be int, float, char or any other data type
Example
#include<stdio.h>
#include<conio.h>
int main()
{
typedef int i;
i ab = 10;
printf("ab = %d\n",ab);
return 0;
}
Output
C:\TDM-GCC-64>gcc typedef.c -o typedef
C:\TDM-GCC-64>typedef
ab = 10
Views: 0