top of page

typedef Declarations

  • Writer: -A
    -A
  • Jan 28, 2020
  • 1 min read

You can create a new name for an existing type using typedef. Following is the simple syntax to define a new type using typedef −

typedef type newname; 

For example, the following tells the compiler that feet is another name for int −

typedef int feet;

Now, the following declaration is perfectly legal and creates an integer variable called distance −

feet distance;

Comments


Post: Blog2_Post

Subscribe Form

Thanks for submitting!

  • Instagram
  • Facebook

©2020 by C++ Programming. Proudly created with Wix.com

bottom of page