C - Typedef3

From EdWiki

Revision as of 09:31, 23 June 2015 by Jshankar (Talk | contribs) (1 revision imported: EdWiki -- Emsys pages from Shukra)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Typedef ...

  • A typedef declaration doesn’t create a new type in any sense; It merely adds a new name for some existing type.
  • typedef is like #define, except that since it is interpreted by the compiler, it can cope with textual substitutions that are beyond the capabilities of the preprocessor.
typedef int (*PFI)(char*, char*);

creates the type PFI, for “pointer to function, of two char* arguments and returning int.”