https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83449

--- Comment #1 from Asif <asif_bahrainwala at hotmail dot com> ---
g++ main.cpp 
main.cpp:10:15: error: pasting ""a"" and ""b"" does not give a valid
preprocessing token
     char *i=A("a","b");
               ^
main.cpp:6:16: note: in definition of macro ‘A’
 #define A(a,b) a ## b
                ^
main.cpp: In function ‘int main()’:
main.cpp:10:19: warning: ISO C++ forbids converting a string constant to
‘char*’ [-Wwrite-strings]
     char *i=A("a","b");
                   ^
main.cpp:6:21: note: in definition of macro ‘A’
 #define A(a,b) a ## b

#########

output from:-
cpp main.cpp 

int main()
{
main.cpp:10:15: error: pasting ""a"" and ""b"" does not give a valid
preprocessing token
     char *i=A("a","b");
               ^
main.cpp:6:16: note: in definition of macro ‘A’
 #define A(a,b) a ## b
                ^
    char *i="a""b";
    cout<<i;
    return 0;
}

Reply via email to