#include /* Raw string literal evaluated before preprocessors for C++11. https://isocpp.org/files/papers/N3690.pdf 2.2.1 in [lex.phases]. */ #define r(R) R"()"[0] int main() { /* Character literals are integers in C99. http://www.stroustrup.com/3rd_compat.pdf Appendex B.2.1 */ if( sizeof('c') > 1 ) { puts("C"); } else { if( r("") == '\0' ) puts("C++11"); else puts("C++98"); } return 0; }