Visual Studio Code | Download and Install VS Code for C/C++ Programming


Visual Studio Code (VS Code) is a software or open-source code editor developed by Microsoft for doing various development operations like coding, debugging, task running, and version control. It can run on Windows, macOS, Linux, and web browsers. It is designed to help developers quickly. You can use it for any programming language without switching editors. VS Code supports almost every major programming language, like HTML, CSS, JavaScript, Python, Java, C, C++, C#, PHP, and more.

Features of Visual Studio Code

  • It can be used for a variety of programming languages, as discussed above.
  • It uses the same editor component as used in Azure DevOps.
  • It can be used in the browser to edit both local files and remote repositories without installing the full program.
  • It provides basic support for most programming languages, like code folding, bracket matching, syntax highlighting, and configurable snippets.
  • It provides various extensions for additional programming languages, which makes it easy for us.

System Requirements for Visual Studio Code

  • Operating system: Windows 10 or 11 (64-bit), macOS, Linux, and more
  • Processor: 1.6 GHz or faster
  • RAM: 1GB or more

Set up Visual Studio Code for C/C++ Programming

To set up Visual Studio Code for C/C++ programming, we need to download three things: Visual Studio CodeMinGW, and the C/C++ Extension.

Steps to Download and Install Visual Studio Code:

  1. Open your web browser (Google Chrome or Opera) and search "download vscode."
  2. Click on the first link, "Download Visual Studio Code - Mac, Linux, and Windows."
  3. Now, you will get three options to download it for Windows, Linux, and Mac. Download it according to your operating system. Suppose you have the Windows operating system, so click on the first download link, "Windows 10, 11."
  4. After downloading the VS Code, install it on your operating system.

Steps to Download and Install MinGW:

  1. Open your web browser and search "MinGW."
  2. Click on the first link, "MinGW-Minimalist GNU for Windows download."
  3. Click on the "Download" link to download.
  4. After downloading MinGW, install it on your operating system.
  5. Now, we will set environment variables, so search "MinGW" on This PC.
  6. Open the first MinGW folder that you found in the search list.
  7. Open the bin folder.
  8. Click on the left side of the search bin to copy the path (C:\MinGW\bin). You will get a highlighted path; just copy it so that we can add it to the system variables after the next few steps.
  9. Open advanced system settings by searching for them in the Windows search.
  10. Click on the environment variables.
  11. Under the system variables, double-click on the path. 
  12. Click on "New" to create a new path and paste the path that we have copied before.
  13. Press enter to save it.

Steps to Download and Install the C/C++ Extension:

  1. Open the VS Code on your computer.
  2. Click on the "extensions" icon.
  3. Search "C/C++" by clicking on the search bar.
  4. Click on the "C/C++" that you found in the search list.
  5. Click on "Install" to install it.
Finally, you have installed Visual Studio Code successfully on your device. Now, you can use this code editor to do various things.

Some Important Points

  • In VS Code, you can save any file with the ".c" extension. For example: hello.c, run.c, etc.
  • To run a code in VS Code, you first click on "Terminal" and then "New Terminal." Further, in a new terminal, write "gcc hello.c" if your file name is hello.c, then press enter and write "./a.exe" if you are using a Windows device; else, write "./a.out" for a Mac device. After this, click enter to get the output on your screen.

Comments