I just started learning c++. I installed visual studio with "Desktop Development with C++". CPlusPlus.com shows info for different c++ versions. How can I check which one I am using?
I just started learning c++. I installed visual studio with "Desktop Development with C++". CPlusPlus.com shows info for different c++ versions. How can I check which one I am using?
3 Comments
o11c@programming.dev · 3 pts · 3y
For what can be supported, see https://en.cppreference.com/w/cpp/compiler_support
Compilers generally have flags to select a version to conform to, and possibly for specific features. There are also several macros you can check. But beware of bugs and lies.
jamesb5@programming.dev · 3 pts · 3y
Check what version of visual studio you’re using. That will have support for certain levels of c++.
If you have 2019 or 2022 installed with the latest updates, you should have complete converse of c++20 and all older standards.
https://devblogs.microsoft.com/cppblog/msvcs-stl-completes-stdc20/
0x0@programming.dev · 2 pts · 3y
See this for reference.
Here's a snippet:
To specify at compile-time, use
g++ -std=c++17for instance.