Basic and Advance C Question:
Download Job Interview Questions and Answers PDF
How can I list all of the predefined identifiers?
Answer:
There's no standard way, although it is a common need. gcc provides a -dM option which works with -E, and other compilers may provide something similar. If the compiler documentation is unhelpful, the most expedient way is probably to extract printable strings from the compiler or preprocessor executable with something like the Unix strings utility. Beware that many traditional system-specific predefined identifiers (e.g. ``unix'') are non-Standard (because they clash with the user's namespace) and are being removed or renamed. (In any case, as a general rule, it's considered wise to keep conditional compilation to a minimum.)
Download C Programming Interview Questions And Answers
PDF
Previous Question | Next Question |
What is the ANSI C Standard? | How can I use a preprocessorif expression to ? |