C - Typedef3
Revision as of 09:31, 23 June 2015 by Jshankar (1 revision imported: EdWiki -- Emsys pages from Shukra)
- 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.”