How to Set up Visual Studio Code for C and C++ Programming

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
what's up everyone and welcome back to this YouTube channel today in this video I'm going to show you how you can run a c or C plus plus program in your Visual Studio code on windows so this is what we will be achieving in this video so I have a C file here and I've written some code it just prints out hello world to the console so if I click on this play icon here you can see I get the output in my visual studio code how cool is that so if you want to do that watch this video till the end I'll show you how you can do the same to achieve what I just showed you we need two things the first one is the Min GW installation on our Windows machine and we need a visual studio extension called code Runner so this is the extension that we need and we first need to install the Min GW so let's begin by installing the Min GW so I'm starting from fresh I have removed the Min GW installation from my computer and I have also removed the code Runner extension from my visual studio code because I'm going to show you how to install and download both so first let's start by Min GW so in order to install the Min GW what you can do is you can go to your browser if it's Chrome you can go to your browser and in the Google you can search for Min GW and you will get this first result which says Ming GW Dash minimalist gnu for Windows download and you need to make sure that the website is sourceforce.net so if you see this result click on it and after that what we'll do is we'll click on this download and it says download will start shortly so let's wait and as you can see the Ming GW setup has been downloaded on my computer so I'm going to click on it and it will prompt me to this window so now I'll click on install and I'm going to select C drive to install my main GW installation and I'll click on continue and it will start uh downloading everything as you can see the download is complete and I'll click on continue now I'll be taken to this window in here I'm going to select GCC and G plus plus and click on Mark for installation and I'm going to click on yeah uh let's let's click on this Min gw32 base as well Mark for installation and I'm going to click on this installation and click on apply changes now again I'll click on apply and it will start to download things for me I'll fast forward again till it completes after it's done you'll see this message are all genes were applied successfully you may close this dialog so let's click on close and close this thing as well now one last thing that we need to do is we need to go to the C drive where we installed the Min GW and in here we need to go to bin and we need to copy this URL from here now go to search bar and search for nyron foreign variables click on environment variables click on this path and we need to paste and click on new and paste the uh path that you just copied click on OK click on OK and close this thing now in order to check if mint GW was installed correctly let's open command prompt CMD search for CMD and click on this command prompt and in here we can see GCC dash dash version click enter you can see it gives us the version number of our GCC installation so it means that we have successfully installed mint GW on our machine if you get any errors that means that you have done something wrong watch the video again and follow the steps very carefully now we have the Min GW installation and we have added the path in our environment variables now we can go to visual studio code and here go to extensions and search for code Runner and this is the extension that we are looking for code runner from Yoon Han click on it install it and after it's installed close this extension tab and let's give it a go so we have this C program here if I run it you can see I get the output if I say printf subscribe save the file run it again you can see the output says subscribe so now that the C program is telling you to subscribe you shouldn't ignore that message and you should subscribe to my channel and like this video so this is it for this video I'll see you in the next one till then peace out
Info
Channel: Code Bear
Views: 1,265,085
Rating: undefined out of 5
Keywords: Visual Studio Code, VS Code, C Programming, C++ Programming, Set Up Visual Studio Code for C C++, C Ide, C++ ide, C Compiler, C++ Compiler, computer programming, programming for beginners, C Video Tutorial, C++ video tutorial, learninglad c++, learninglad mingw
Id: 9VE7p-he4fA
Channel Id: undefined
Length: 5min 44sec (344 seconds)
Published: Sun Nov 27 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.