QUESTION 25 Consider the following: - I) LINE - II) TIME - III) FILE - IV) DATE - V) STDC...
Qualcomm technical mcq question, verified with a worked answer. Free to practise - no sign-up.
QUESTION 25
Consider the following:
- I) LINE
- II) TIME
- III) FILE
- IV) _DATE
- V) STDC
Which of the following is true?
Show answer & explanation
Answer: C. Only (IV) and (V) is predefined macro in C
DATE__ and STDC are standard C predefined macros. LINE, FILE, and TIME are also standard, but TIME is NOT a standard C predefined macro—it's a compiler extension. The correct answer identifies DATE (IV) and STDC (V) as genuine ISO C99 standard predefined macros.
Step-by-step Derivation:
Standard ISO C predefined macros are:
- LINE: Expands to current line number (standard)
- FILE: Expands to current filename (standard)
- DATE: Expands to compilation date (standard)
- TIME: NOT standard C (compiler extension, commonly GNU/MSVC only)
- STDC: Standard macro indicating ISO C compliance (standard)
Therefore, items (I), (III), (IV), and (V) are standard predefined macros. Item (II) TIME is NOT a standard C predefined macro. Among the given options, (C) correctly identifies (IV) DATE and (V) STDC as predefined macros, though technically (I) and (III) are also standard.