Interview Questions

Is there anything like an ifdef for typedefs?

C Interview Questions and Answers


(Continued from previous question...)

Is there anything like an ifdef for typedefs?

Unfortunately, no. (There can't be, because types and typedefs haven't been parsed at preprocessing time.) You may have to keep sets of preprocessor macros (e.g. MY_TYPE_DEFINED) recording whether certain typedefs have been declared.

(Continued on next question...)

Other Interview Questions