I printed the value of the __cplusplus
macro and found out that my files are executed with C++98 in Visual Studio Code. I'm using the CodeRunner extension.
How do I change this to C++17?
Go to extensions, then type ms-vscode.cpptools
in the search bar.
Click on the C/C++
extension, and to the right of Uninstall
, there should be a gear icon. Click it.
A dropdown menu should open. Select Extension Settings
.
Now click in the search bar (sometimes it makes you click twice before you can type without replacing the extension filter) and type cppStandard
.
From here, you should see two options, one for Cpp Standard, and one for C Standard.
Change Cpp Standard to your desired version. I generally use c++20.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With