True / False Questions

Question 11 :

In a macro call the control is passed to the macro.


A). True
B). False
Answer : Option B

Explanation :

False, Always the macro is substituted by the given text/expression.


Question 12 :

A header file contains macros, structure declaration and function prototypes.


A). True
B). False
Answer : Option A

Explanation :

True, the header file contains classes, function prototypes, structure declaration, macros.


Question 13 :

The preprocessor can trap simple errors like missing declarations, nested comments or mismatch of braces.


A). True
B). False
Answer : Option B

Explanation :

False, the preprocessor cannot trap the errors, it only replaces the macro with the given expression. But the compiler will detect errors.


Question 14 :

A preprocessor directive is a message from compiler to a linker.


A). True
B). False
Answer : Option B

Explanation :

FALSE

Example: #define symbol replacement

When the preprocessor encounters #define directive, it replaces any occurrence of symbol in the rest of the code by replacement. This replacement can be an statement or expression or a block or simple text.


Question 15 :

Once preprocessing is over and the program is sent for the compilation the macros are removed from the expanded source code.


A). True
B). False
Answer : Option A

Explanation :

True, After preprocessing all the macro in the program are removed.