Home >Backend Development >C++ >How to Change the C Language Standard in VS Code with CodeRunner?
Changing C Language Standard in VS Code with CodeRunner
Visual Studio Code defaults to C 98 for execution when using the CodeRunner extension. However, you can easily switch to a different C language standard, such as C 17 or C 20.
Solution:
Once you make the adjustment, the C files will be executed using the selected language standard. To verify, you can include the following code in a C file:
#include <iostream> int main() { if constexpr (sizeof(int) == 4) // C++11 feature std::cout << "int is 32 bits" << std::endl; return 0; }
With C 17 selected, the code will correctly output that "int is 32 bits," confirming the change in language standard.
The above is the detailed content of How to Change the C Language Standard in VS Code with CodeRunner?. For more information, please follow other related articles on the PHP Chinese website!