Difficulty: Easy
Correct Answer: MESS
Explanation:
Introduction / Context:
Preprocessor macros perform textual substitution before compilation, but they do not modify the contents of string literals. This question verifies that understanding.
Given Data / Assumptions:
Concept / Approach:
During preprocessing, identifiers inside string literals are not expanded. Only tokens outside string literals are candidates for macro substitution.
Step-by-Step Solution:
Preprocessor sees printf("MESS\n"); unchanged.At runtime, printf prints the literal text MESS followed by a newline.
Verification / Alternative check:
If the code were printf("%s\n", MESS); without quotes around MESS, then the token MESS would expand to junk and compilation would likely fail (undefined identifier) unless junk were defined as a string.
Why Other Options Are Wrong:
"junk": would require macro expansion inside the string literal, which does not occur.Error / nothing: the code is valid and prints text.
Common Pitfalls:
Expecting the preprocessor to parse inside quotes; forgetting that stringization requires the # operator within a macro definition.
Final Answer:
MESS
Discussion & Comments