Typedef is commonly used to give any Data Type a new name.
Like for example:
Code:
#include<iostream>
int main()
{
typedef int a; // Thus, a refers automatically to an integer
a abc=1, def=0; // Creates two variables of type int,
// as the typedef above shows
cout<<"ABC = "<<abc<<" DEF = "<<def<<endl;
return 0;
}
This is very useful while working with a lot of classes, or structures. You can name them comfortably or for different usages (Like we use Position and List names in a clear Linked List algorithm but both are essentially the same structure, just used with a different name to aide understanding).