check compiler version c 2b 2b

Solutions on MaxInterview for check compiler version c 2b 2b by the best coders in the world

showing results for - "check compiler version c 2b 2b"
Julian
25 Nov 2019
1#include <iostream>
2#include <typeinfo>
3
4int main()
5{
6    if (__cplusplus == 201703L) std::cout << "C++17\n";
7    else if (__cplusplus == 201402L) std::cout << "C++14\n";
8    else if (__cplusplus == 201103L) std::cout << "C++11\n";
9    else if (__cplusplus == 199711L) std::cout << "C++98\n";
10    else std::cout << "pre-standard C++\n";
11
12}