You can create a new name for an existing type using typedef. Following is the simple syntax to define a new type using typedef:
For example, the following tells the compiler that feet is another name for int:typedef type newname;
Now, the following declaration is perfectly legal and creates an integer variable called distance:typedef int feet;
feet distance;
No comments:
Post a Comment