What will be the output of the following C code? [code]#define F abc #define B def #define FB(arg) #arg #define FB1(arg) FB(arg) main() {

What will be the output of the following C code?
Code:
#define F abc
#define B def
#define FB(arg) #arg
#define FB1(arg) FB(arg)
main()
{
    printf(FB(F B));
    FB1(F B);
}
A. F B
B. Error
C. FB
D. “FB”
 
Answer: a
Explanation: The argument F B(only one space between F and B) is passed to the macro FB. This argument is converted to a string with the by the stringizing operator. Thus F B is printed.
 

Tìm kiếm

Back
Top