Programming with C

⌘K
  1. Home
  2. Docs
  3. Programming with C
  4. Basics of C Programming
  5. Storage Classes
  6. Typedef Storage Class

Typedef Storage Class

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

How can we help?

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments