The quickest way to check your C version
Open the terminal in Visual Studio Code by pressing Ctrl+` (backtick) on Windows or Linux, or Cmd+` on Mac. Then type gcc --version if you're using GCC, or clang --version if you're using Clang. The output will show you which C standard your compiler supports — look for a line that says something like "gcc (GCC) 11.2.0" or similar.
The version number tells you which C standard your compiler can handle. GCC 9 and later support C17 (also called C18). Clang 3.1 and later also support C17. If you see an older version, your compiler may only support C11 or C99, which affects what language features you can use in your code.
If you don't have GCC or Clang installed yet, you'll get a "command not found" error. In that case, you need to install a C compiler first — the steps vary by operating system, and Visual Studio Code will often prompt you to install one when you try to compile C code.
Key Takeaways
- Run gcc --version or clang --version in the Visual Studio Code terminal to see your compiler version and which C standard it supports.
- The compiler version number tells you the maximum C standard available — GCC 9+ and Clang 3.1+ support C17, while older versions may only support C11 or C99.
- If the command returns "not found", you need to install a C compiler on your system before you can compile C code.
- You can also check which C standard your project is set to use by looking at your compiler flags in the build configuration or tasks.json file.
Understanding compiler versions and C standards
The C language has evolved through different standards over time: C89, C99, C11, C17, and C23 are the main ones. Each standard adds new features and fixes. Your compiler version determines which of these standards it can understand and compile.
When you run gcc --version, you're checking the version of GCC (GNU Compiler Collection), not the C language version itself. But the GCC version number correlates to which C standards it supports. For example, GCC 5.0 and later support C11, and GCC 9.0 and later support C17. Clang follows a similar pattern.
This matters because if you write code using C17 features but your compiler only supports C11, you'll get compilation errors. Knowing your compiler version helps you understand what language features are available to you.
Finding your compiler in Visual Studio Code settings
Visual Studio Code doesn't have a built-in menu to show your C compiler version. Instead, it relies on whatever C compiler is installed on your system. You can see which compiler Visual Studio Code is configured to use by opening the Command Palette (Ctrl+Shift+P on Windows/Linux or Cmd+Shift+P on Mac) and typing "C/C++: Select a IntelliSense Configuration".
This will show you the compiler paths that Visual Studio Code has detected. Common paths include C:\MinGW\bin\gcc.exe on Windows, /usr/bin/gcc on Linux, or /usr/bin/clang on Mac. Once you know the path, you can run that exact command in the terminal to check its version.
If Visual Studio Code hasn't detected a compiler, you'll see a message saying no configurations were found. This means you need to install a C compiler first. On Windows, MinGW or Microsoft Visual C++ are common choices. On Mac, you can install Clang through Xcode Command Line Tools. On Linux, GCC is usually pre-installed or available through your package manager.
Checking the C standard your project uses
Even if your compiler supports C17, your project might be configured to use an older standard like C11 or C99. This is controlled by compiler flags. If you're using Visual Studio Code's built-in build task, check your tasks.json file (usually in the .vscode folder in your project). Look for a line containing -std=c11, -std=c99, or -std=c17.
If you see -std=c17, your project is set to use the C17 standard. If you see -std=c11, it's using C11. If there's no -std flag at all, your compiler will use its default standard, which is usually C99 or C11 depending on the compiler version.
To change which C standard your project uses, edit the tasks.json file and modify the -std flag. For example, change -std=c99 to -std=c17 if your compiler supports it. Then save the file and rebuild your project.
Installing or updating a C compiler
If you don't have a C compiler installed, or if you have an old version, you'll need to install or update one. On Windows, download MinGW-w64 from the official website or use a package manager like Chocolatey. On Mac, open Terminal and run xcode-select --install to get Clang through Xcode Command Line Tools. On Linux, use your package manager: sudo apt-get install gcc on Ubuntu/Debian, or sudo yum install gcc on Fedora/RHEL.
After installation, close and reopen Visual Studio Code, then run gcc --version or clang --version in the terminal again to confirm the installation worked. Visual Studio Code should now detect your compiler automatically.
Frequently Asked Questions
What's the difference between compiler version and C standard version?
Compiler version (like GCC 11.2.0) is the version of the tool that translates your code. C standard version (like C17) is the language specification your compiler understands. A newer compiler usually supports newer C standards, but they're separate things.
Can I use C17 features if my compiler only supports C11?
No. If your compiler only supports C11, you can't use C17-specific features like _Generic or _Alignof. You'll get a compilation error. You need to either upgrade your compiler or rewrite your code to use only C11 features.
Why does my compiler version show but I still get errors when compiling?
Having a compiler installed is only part of the setup. Visual Studio Code also needs the C/C++ extension by Microsoft, and your project needs a proper build configuration (tasks.json or a Makefile). Check that the extension is installed and that your build task is configured correctly.
Is there a way to check the C version without opening the terminal?
Not directly in Visual Studio Code's interface. The terminal is the most straightforward way. However, if you try to compile code with a C17 feature and your compiler doesn't support it, the error message will tell you what standard is missing.