C | Macro & Preprocessor | Question 14

filter_none

edit
close

play_arrow

link
brightness_4
code

#include <stdio.h>
#define get(s) #s
  
int main()
{
    char str[] = get(GeeksQuiz);
    printf("%s", str);
    return 0;
}

chevron_right


(A) Compiler Error
(B) #GeeksQuiz
(C) GeeksQuiz
(D) GGeeksQuiz


Answer: (C)

Explanation: The preprocessing operator ‘#’ is used to convert a string argument into a string constant.

Quiz of this Question



My Personal Notes arrow_drop_up