C Language and Libraries Help (clang.hlp) (Table of Contents; Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
typedef
                                             Up Contents Index Back
─────C/C++ Language─────────────────────────────────────────────────────────
 
  Keyword:   typedef
 
  Syntax:    typedef type-declaration;
 
  Summary:   Defines a synonym for the specified <type-declaration>.
             The identifier in the <type-declaration> becomes another name
             for the type, instead of naming an instance of the type.
 
  See also:  class, struct, enum, union
 
  Example:
 
          typedef unsigned long ulong;
 
          ulong ul;     // Equivalent to "unsigned long ul;"
 
          typedef struct mystructtag
          {
              int   i;
              float f;
              char  c;
          } mystruct;
 
          mystruct ms;   // Equivalent to "struct mystructtag ms;"
 
          typedef int (*funcptr)();  // funcptr is synonym for "pointer
                                     //    to function returning int"
 
          funcptr table[10];   // Equivalent to "int (*table[10])();"
                                    -♦-