[0:00]Welcome back. In today's video, we're going to get your environment ready for C programming. We will walk through installing the MinGW compiler and configuring the official Microsoft C C++ extension.
[0:11]By the end of this tutorial, you'll have a fully functional setup ready to compile and run your first C program. So let's begin.
[0:17]Step one, head over and download MinGW to get started. First, open up Google Chrome from your task bar or the start menu.
[0:24]Once the browser is open, head over to the search bar and type MinGW download. Then press enter to continue.
[0:30]Hit that first result right there. That's the official MinGW site where we'll grab the download. Next, click on the download button.
[0:38]You'll find it exactly where I'm pointing. After a short wait, the download will start automatically. Just let it complete before moving on to the next step.
[0:44]Step two, next, we're going to install MinGW. Don't worry, it's straightforward. Now, let's open up the downloads folder.
[0:50]You'll find the setup file right there. Go ahead and double click it and let's kick off the installation. All right, first things first, close out any other windows.
[0:58]This is the first page of the MinGW setup tool. Simply click on install and we'll walk through the rest together.
[1:05]Now, here's where you select your installation folder. By default, it's going to install in C MinGW.
[1:10]Want it somewhere else? No problem, just hit change and choose your preferred location. Keep it on default and click continue.
[1:16]The MinGW setup has started. Just hang tight while the next screen loads. Perfect. Now smash that continue button and let's keep going.
[1:24]You'll notice there are six MinGW packages. Simply select each of them individually. When you see the package, just click Mark for installation to add it.
[1:34]Got all your packages ready? Awesome. Now head to installation and smash that apply changes button. Now just hit apply again.
[1:39]That'll start the package installation process and it'll be done in a few minutes. Once all the packages are installed, you'll see a new dialog box pop up.
[1:46]Just click close and go ahead and close the second window as well. Step three, configure your environment variables.
[1:52]This step makes sure your system can recognize and use the MinGW compiler properly. Now go ahead and open your C drive, find the MinGW folder.
[1:59]Open the bin folder inside it and copy the complete path. Open the start menu, type edit environment variables and hit enter to launch it.
[2:08]In the system properties window, go ahead and click on environment variables. Now, head over to the system variables section, find the path variable and hit edit.
[2:16]Next, click on new and simply paste in the MinGW path we copied earlier. Just go ahead and click okay on all the prompts.
[2:23]Let's quickly verify this. Jump to the Windows start menu, search for CMD and launch the command prompt.
[2:30]Type GCC hyphen hyphen version command and hit enter. If a version number shows up, that means everything's working perfectly.
[2:36]Step four, install the VS code extensions. Go ahead and open VS code or Visual Studio.
[2:42]Next, click the last icon to open the extensions section, then search for C/C++.
[2:49]Make sure you pick the C-C++ extension by Microsoft. This one right here. Now click on install and wait a few seconds while the package finishes installing.
[2:57]After the package installs, the next step is selecting your default compiler. Simply click on select my default compiler.
[3:04]In the top section, you'll see options for GCC.exe and G++.exe, both provided by MinGW.
[3:12]Just go ahead and pick either one. Hit Mark done and let's quickly close any extra VS code windows you've got open. All right, step five.
[3:19]Time to run your first C or C++ program and see everything in action. Click on the explorer icon to open up your files.
[3:26]Now, head over to any location you prefer and create a brand new folder to keep everything organized. For this demo, we're going to create a folder called Sample.
[3:34]You might see a quick warning about the folder's source. That's totally normal. Just click yes, I trust the authors to continue. It's safe and we're good to go.
[3:42]Next up, hit that plus file icon to create a new program. Then just name your file and make sure you add dot C at the end.
[3:49]Once that's done, the file opens up in the editor, ready for you to write your very first C program. Type out your first program, the famous Hello World.
[3:59]Press control S to save the program file. Next up, click the play button in the top right. Choose Run C/C++ file from the dropdown and your program runs instantly with any compiler you've got set up.
[4:10]You'll see the output. Hello, world! appear right here in your terminal. And that's it. You're all set to start coding in C.
[4:16]If this helped you out, make sure to hit that like button. It really supports the channel. Thanks for watching!



