In this article, we are going to set up C Programming Language on Windows 10 using one of the most popular editors called Visual Studio Code (VSC).
1. Brief Introduction to C Programming Language
C is a powerful programming language and it is also a general-purpose language that is used to develop software like operating systems (OS), compilers, and so on. It was developed by Dennis M. Ritchie in 1972 at the Bell Telephone Laboratories.
2. What needs to be installed
Before we proceed to the steps involved in Setting up C, we need to have Visual Studio Code and git installed on our local machine (Computer). If you already have that installed then a big hug to you if not click here to download Visual Studio Code for Windows and also click here to download git for Windows. With that installed let's get down to business
3. Steps involved in setting up C
Note:
- A > sign followed by a text shows the next button to click
- Yellow Arrow directions in images are for guidance
Step 1: Downloading C Compiler
According to Britannica: compilers are computer software that translates (compiles) source code written in a high-level language like C into a set of machine-readable language. The C compiler to download is Mingw, After clicking the link, download the part that says "This is smaller if you've already installed git". At the time of writing this, it is at version 18.0 as shown below
After downloading and during installation make sure you extract to the root folder C:\ and click on extract as shown below
Step 2: Adding C Compiler to path
After extracting, click on This PC > Local Disk (C:) > MinGW > bin and copy the address path as shown below
After copying go back to This PC and right-click on an empty space then click on properties > Advanced system settings > Environment variables > path > Edit > New then paste the address path we copied from the MinGW (bin) in it and click on ok thrice to close all windows as shown below
Step 3: Install C Extension from Visual Studio Code
Open up the visual studio code editor and navigate to the extension market and search for C/C++ and make sure to select the one from Microsoft and install it as shown below
After installation, click on Terminal > Run Build Task and click on the C/C++. Also, search for Code Runner in the extension market and make sure to select the one from Jun Han and install it as shown below
After installing, click on File > Preferences > Settings then search "Run in terminal" from the search bar and check "Code-runner: Run In Terminal" as shown below
C Lovers, we are all set to write our first program in C and ready to compile. Write a basic C Program like the one shown below and use the keyboard shortcut "Ctrl + Alt + N" or click on the play button to compile
We are all done and my fellow C Lovers you can all party with C now. Happy Hacking
If you find this article helpful, you can follow me on my social media handle @DevWaslead, you can also comment and like. Thank You