I’ve used C++17 in VS Code. Now I want to use C++20 or C++23, but I can’t change from the C++17 version.
I’ve tried many ways, like adding "-std-c++2b" in Task.json or setting C++Standard to C++23, but my VS Code is still in C++17. Maybe I reinstalled VS Code and set it again?
2
Answers
I used
__cplusplus
to check version c++ , here is my complile when i use C/C++ and Code Runner extension :the result is
c++17
.I tried to run the compile with mingw64 from MSYS2 :
the result is
c++20
. Another , i used C/C++ runner extension to run and the result still inc++17
:In the VSCode project browse the
.vscode
folder and in thetasks.json
type something like this (adapt it to your needs regarding the version):Also try to configure the
c_cpp_properties.json
:Finally rebuild your project. It should work for you.