Back To C Basics Index
typedef keyword can be used to give a new name to a datatype, in the code given below int datatype is given a new name integer and float keyword is given a new name decimal
//program to demonstrate typedef keyword (typedef keyword can be used to give a new name to a datatype) #include
#include
void main() { typedef int integer; typedef float decimal; integer a; decimal pi=3.14; clrscr(); printf("\nenter a value for a "); scanf("%d",&a); printf("\nvalue of a is %d",a); printf("\nvalue of pi is %f",pi); getch(); }