-
What will be the output of the following C code?
#include <stdio.h>
#define function(p, q) p ## q
int main()
{
printf("%s\n", function(a, b));
}
-
- p q
- a b
- Undefined behaviour
- Compilation Error
- None of these
Correct Option: D
Compilation Error
main.c: In function ‘main’:
main.c:5:33: error: ‘ab’ undeclared (first use in this function)
printf("%s\n", function(a, b));
^
main.c:2:28: note: in definition of macro ‘function’
#define function(p, q) p ## q
^
main.c:5:33: note: each undeclared identifier is reported only once for each function it appears in
printf("%s\n", function(a, b));
^
main.c:2:28: note: in definition of macro ‘function’
#define function(p, q) p ## q