The typedef (meaning type definition) command allows the programmer to define a new name for a particular type.
In reality, this keyword to create a synonym, which is different from creating a new type. typedef is followed by the name of the existing type and then alias and a semicolon. Its general form is:
typedef unsigned short int USHORT;
Now there is also another data type which is known as USHORT and which is the Reference to the unsigned short int. Means Now we can also use USHORT instead of unsigned short int data type.
// Demonstration of the use of the keyword typedef
typedef unsigned short int USHORT; // alias definition
int main ()
USHORT width = 5;
length = 10;
USHORT Area = width * length;
cout << "Width :" << width<<endl;
cout << "Length :"<< length <<endl;
cout << "Area :" <<Area << endl;
This program producesthe following result