2,172 views
3 votes
3 votes
Choose the False statements:
(a) The scope of a macro definition need not be the entire program
(b) The scope of a macro definition extends from the point of definition to the end of the file
(c) A macro definition may go beyond a line
(d) None of the above

2 Answers

Best answer
4 votes
4 votes

(a) TRUE. Scope of macro need not be the entire program. A macro defined by

#DEFINE

preprocessor statement can be undefined using the

#UNDEF

An example: https://stackoverflow.com/questions/17349387/scope-of-macros-in-c

(B) TRUE. By default, the scope of a macro definition extends from the point of definition to the end of the file. Unless you use #UNDEF as described above.

(C) TRUE. You use \ as a line continuation escape character for defining multi-line macros.

see: https://stackoverflow.com/questions/10419530/multi-line-preprocessor-macros

So, all are correct statements. And answer is (D)

selected by

Related questions