Answers for "how to know my c++ compiler version"

C++
1

check compiler version c++

#include <iostream>
#include <typeinfo>

int main()
{
    if (__cplusplus == 201703L) std::cout << "C++17n";
    else if (__cplusplus == 201402L) std::cout << "C++14n";
    else if (__cplusplus == 201103L) std::cout << "C++11n";
    else if (__cplusplus == 199711L) std::cout << "C++98n";
    else std::cout << "pre-standard C++n";

}
Posted by: Guest on July-15-2020

Code answers related to "how to know my c++ compiler version"

Browse Popular Code Answers by Language