A typedef is a user-defined synonym for an existing type. To create a synonym for a type, you use the keyword typedef followed by the name of the type and the new name you are defining. Because typedef is a C++ statement, you also need a closing semicolon:

typedef unsigned int positiveNumber;

This typedef declares positiveNumber to be a synonym of unsigned int and can be used in a declaration instead of the actual type name:

positiveNumber one, two;

Microsoft Visual C++  .NET(c) Step by Step
Microsoft Visual C++ .NET(c) Step by Step
ISBN: 735615675
Year: 2003
Pages: 208

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net