Setting Up VSCode for Windows
Was this helpful?
Was this helpful?
Visit the official .
Download the installer for Windows.
Run the installer (.exe
file) and follow the on-screen instructions to install VSCode.
Open VSCode after installation.
Go to the Extensions view by clicking on the Extensions icon in the Activity Bar on the side of the window or using the keyboard shortcut Ctrl+Shift+X
.
In the Extensions view search box, type "C/C++".
Install the extension provided by Microsoft.
Download and install MinGW (Minimalist GNU for Windows):
Visit the .
Click on "Downloads" in the left sidebar.
Download the installer for your architecture (32-bit or 64-bit).
Run the installer and follow the installation instructions.
After MinGW installation, locate the installation directory (e.g., C:\MinGW
).
Add the MinGW bin
directory to the system Path:
Right-click on "This PC" or "Computer" on your desktop or in File Explorer.
Select "Properties" > "Advanced system settings."
Click on "Environment Variables."
In the "System variables" section, find and select the "Path" variable, then click "Edit."
Click "New" and add the path to the MinGW bin
directory (e.g., C:\MinGW\bin
).
Click "OK" to close the windows.
Open VSCode.
Click on "File" > "New File" to create a new file.
Save the file with a .c
extension, for example, hello.c
.
Write your C code in the editor.
Open the terminal in VSCode.
Compile the code using the following command:
Run the compiled program:
While VSCode is a great choice, you can explore alternative IDEs for C programming on Windows:
Choose an IDE that best suits your preferences.
This guide has helped you set up Visual Studio Code for C programming on Windows. Whether you continue with VSCode or explore other IDEs, make sure to choose the one that enhances your coding experience. Happy coding!
Dev-C++:
Code::Blocks: