Skip to content

Instantly share code, notes, and snippets.

@j2doll
Created August 20, 2018 04:12
Show Gist options
  • Select an option

  • Save j2doll/516889ba1e85d482d4dda9f6ca701cfd to your computer and use it in GitHub Desktop.

Select an option

Save j2doll/516889ba1e85d482d4dda9f6ca701cfd to your computer and use it in GitHub Desktop.
gcc(g++) C++ STL version
// for checkg support C++ (using g++)
//
// g++ -std=c++98 main.cpp
// g++ -std=c++03 main.cpp
// g++ -std=c++0x main.cpp
// g++ -std=c++11 main.cpp
// g++ -std=c++14 main.cpp
// g++ -std=c++17 main.cpp
#include <iostream>
using namespace std;
int main(){
int cpp = (int) __cplusplus;
int year = cpp / 100; // 1997 ... 2017
int month = cpp % 100;
cout << "Year:" << year << " Month:" << month << endl;
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment