How to determine what C++ standard is the default for a C++ compiler?

What about compiling and executing the following trivial program ?

#include <iostream>

int main()
 { std::cout << __cplusplus << std::endl; }

The value printed should say the version used:

  • 199711 for C++98,
  • 201103 for C++11
  • 201402 for C++14
  • 201703 for C++17

If you compile omitting the -std=c++xx flag, you should be able to detect the default version of language used.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)