False, The scope of macros is globals and functions. Also the scope of macros is only from the point of definition to the end of the file.
Discuss About this Question.
A macro must always be defined in capital letters.
A:
True
B:
False
C:
D:
Answer:B
FALSE, The macro is case insensitive.
Discuss About this Question.
Macro calls and function calls work exactly similarly.
A:
True
B:
False
C:
D:
Answer:B
False, A macro just replaces each occurrence with the code assigned to it. e.g. SQUARE(3) with ((3)*(3)) in the program.
A function is compiled once and can be called from anywhere that has visibility to the funciton.
Discuss About this Question.
A preprocessor directive is a message from programmer to the preprocessor.
A:
True
B:
False
C:
D:
Answer:A
True, the programmer tells the compiler to include the preprocessor when compiling.
Discuss About this Question.
There exists a way to prevent the same file from getting #included twice in the same program.
A:
True
B:
False
C:
D:
Answer:A
True, We can prevent the same file from getting included again by using a preprocessor directive called #ifndef (short for "if not defined") to determine whether we've already defined a preprocessor symbol called XSTRING_H. If we have already defined this symbol, the compiler will ignore the rest of the file until it sees a #endif (which in this case is at the end of the file).
#ifndef XSTRING_H
#define XSTRING_H
defines the same preprocessor symbol,
Finally, the last line of the file,
#endif
Discuss About this Question.
Ad Slot (Above Pagination)
Install ExamAdept
Fast access — add this app to your device.
To install on iPhone/iPad: tap Share → Add to Home Screen.
Discuss About this Question.