C | Macro & Preprocessor | Question 8
#include <stdio.h> #define a 10 int main() { printf("%d ",a); #define a 50 printf("%d ",a); return 0; } |
chevron_right
filter_none
(A) Compiler Error
(B) 10 50
(C) 50 50
(D) 10 10
Answer: (B)
Explanation: Preprocessor doesn’t give any error if we redefine a preprocessor directive. It may give warning though. Preprocessor takes the most recent value before use of and put it in place of a.
Recommended Posts:
- C | Macro & Preprocessor | Question 10
- C | Macro & Preprocessor | Question 9
- C | Macro & Preprocessor | Question 11
- C | Macro & Preprocessor | Question 13
- C | Macro & Preprocessor | Question 14
- C | Macro & Preprocessor | Question 1
- C | Macro & Preprocessor | Question 2
- C | Macro & Preprocessor | Question 6
- C | Macro & Preprocessor | Question 7
- C | Macro & Preprocessor | Question 5
- C | Macro & Preprocessor | Question 12
- C | Macro & Preprocessor | Question 15
- C | Macro & Preprocessor | Question 14
- C | Macro & Preprocessor | Question 4
- The OFFSETOF() macro



