hey Savi Deb's its Savi Nick here and today I'd like to take a moment in announcing new series that will be creating which will involve programming with C and C++ on a Linux platform this will be the first video in the series what we'll be doing first in this series is setting up a programming environment that consists of Ubuntu and Visual Studio code since Visual Studio code is simple to download and set up we'll go ahead and run through how to install Visual Studio code and create our first C C++ program and once we know that our environment here is set up correctly we'll be able to go ahead and start the series out let's go ahead and show you how to install it in Abood - it's very easy graphically you can go to the Ubuntu Software Center click on that and it's also easy to install on various other different Linux distributions if you need help installing Ubuntu or many other different types of Linux distributions you can go ahead and find plenty of installs on my channel I'll go ahead and supply a link in the description to a video for Ubuntu the great thing about visual studio is that it's available for many different distributions and we're going to focus on trying to make these tutorials as generic as possible so users of various different types of Linux distributions as well as people on Windows and Mac OS who are interested in programming can follow along so with all selected and this little magnifying glass so we can search let's go ahead and search for visual should be the first thing that pops up here and it is and of course the great thing about Visual Studio code is that it's available for almost every platform so you can go ahead and simply use this application across Linux Mac OS Windows we'll go ahead and click the very first option here it tells you that there's Visual Studio code available which is a lightweight but powerful source editor let's go ahead and hit the install button for more information about it there's information here at the bottom about the current version and some of the languages that it supports which there's much more languages because of something that they call extensions let's go ahead and hit install and let the install begin so put in your administrative password and authenticate that so it can install and make sure you take a second and subscribe so you can follow the series along as are releasing videos here on the channel and once the application is installed all you have to do is hit the launch or go ahead and search for it so once you've opened up your new install of Visual Studio code the IDE will show you a welcome page which just runs through a few items here things that get you started as well as help content here at the bottom some videos tips and tricks repos etc there on the right-hand side it gives you information of how to customize the ID as well as learning more about it and the commands that are available for it the first thing I'm gonna do is gain focus on this right after we go through what's available here up top in the drop downs file allows you to do things like you would expect create new files new windows open existing files or workspaces and edit preferences as well as make saves and edit you can undo redo cut copy and paste also find various search patterns that are available throughout your projects a selection just allows you to select move lines up and down as well as copy them and also add various things so view is always important since you can go ahead and edit your appearance in here as well as edit the editor however you like it so you get a nice workspace that you can use on go that just gives you some shortcuts while you're programming debug allows you to use the debugger start stop debugging and put in breakpoints and then on the terminal side you can actually build the current application that you're working with and even run it and on help that just allows you to get more help on how to use the IDE as well as various different types of documentation and notes as well as checking for updates on the left-hand side of the IDE or go ahead and minimize these real quick you'll see that you have something called Explorer and Explorer is just really your project Explorer which allows you to open various editors up and what they consider editors are just pages on the right-hand side that you are working with and making edits to folders are just folders on your file system that you have opened and those can really be considered projects which will create one in a moment and then on the bottom you have outline which we won't focus on quite yet let's go ahead and exit out of here and as you can see it says that there's no open editors anymore and it defaults you to some shortcuts here on the right-hand side now search will allow you to search through various different folders and replace items inside of various files that you're searching through you can make them case sensitive and even specify what types of extensions you are targeting and then on the source control you can actually get visual studio code working with a repository so you can make programming a lot easier on yourself allowing you to commit and pull down commits directly from here we'll get into how to use this later but just know that you can get this working with something such as github and use a repository next is the debugging configuration you can actually set up a debug configuration and then watch various variables on the stack as well as expressions that you might add in which you can add through here and view what's currently on the call stack as well as what breakpoints you have available finally an important part here the extensions extensions are just add-ons from people who have submitted them for visual studio code that makes your life a lot easier will actually be installing a few extensions in order for us to be able to run AC C++ program in Visual Studio code here so let's make the view a little bigger so you can kind of see what I'm doing here so zoom in it should be pretty good and then I'll go ahead and put it in the full-screen mode here if you made it this far go ahead and take a moment to like the video really does help me out and let's go ahead and search the marketplace for a C++ app so if we just type in C++ we'll see a few options here and the first option is actually what we want the C C++ app and if we click on it we'll see more information about it it says that it allows you to debug C++ applications browse them easier as well as automatically fill in functions from available libraries makes life a lot easier while programming in C or C++ and you can see here at the bottom more information on the package let's go ahead and install this package or as they call them extension and the IDE will tell you once it's installed and enabled next I want to grab one more so let's go ahead and type in run up here on the top for extensions and what we want is the code runner this is a great application for multiple different programming languages that allows you to build and run your application right in this Visual Studio code I suggest using this no matter what language you're using because it's available for many different languages and you can see all of those various languages here so some of the main ones of course is C C++ Java JavaScript Python PHP Perl Ruby and that's just a few of the overall available ones let's go ahead and also install this package and it tells me that it is now enabled globally instance we got those two packages now we can go ahead and create a program so going back to the Explorer we're gonna go ahead and open up a folder let's go ahead and click the open folder button this is where our project is going to exist so I'm actually gonna use the Savi NIC documents directory so if I click documents I'll go ahead and add a new folder in here I'm just gonna call it simple lists for now and I'm just gonna create that you can of course call your project whatever you want and it could be located in any directory that you want since simplest is fine by me I'm gonna go ahead and hit the ok button give it a moment to refresh real quick and now you see that we have simple list available here in under simple lists we can now add a new file a new folder refresh it as well as minimize or maximize the simplest also if you right-click you can see that you can add a new folder to the workspace as well as edit settings create new files so just know that that's an option I'm going to go ahead and exit out of this welcome screen and then I'm going to create a new file and that new file will be called main.cpp this is pretty typical of C and C++ applications naming the file main.cpp since the C++ compiler looks for main first in order to execute it and run your program so since it's the starting place main.cpp makes sense to use for the name of the file so let's go ahead and create that main function here at the bottom you'll get occasional recommendations so it says that there is a newer update for one of the C C++ extensions that we just got finished installing so I'm just gonna say to ask me later again since I don't want to install it right away but of course you want to stay up with the latest and greatest in your extensions let's go ahead and create that main function the first thing we'll have to do is include the iostream library so we can write in and out of the council once we've included that library we're gonna go ahead and define int main the main function keep these guys together and then let's put some braces and then in between those braces will put our statements in the statement that we're gonna put in here is just a simple hello world message to our console showing that our program is running and that it can spit something out into the console the way we do this is let's go ahead and do STD colon colon here C out so C out say function supplied by the iostream library that allows us to print out characters to a council and those characters are going to be hello world with an exclamation point and I'll use one more standard library function called end line or E and DL and then I'll put a colon at the end to terminate my statement and all that this does is creates a new line in the console after spitting out hello world so finally the last thing is I want to return something so this is just a tell whatever's executing this program that things have successfully ran so we've defined a data type of an integer and that integer we're returning after all these statements inside of main have been around and ran successfully is a zero to pass out of this function another thing to focus on is as you see this little circle up here next to main.cpp that just tells you that the that there are unsaved changes currently so go ahead and hit ctrl s or do file save in order to save your program as it is currently and once you've saved it you can simply run the code by hitting the play button up here in the right corner so let's go ahead and do that hit the play button give it a moment to compile and execute and as you can see what happened was it was our extension that we added in that code run extension was executed a command which change directories to our simple list project and ran a compilation of the main CPP and I'll put it a main program and finally it ran the program here in the directory that it was located in so after all that was done we see that our program spit out hello world exclamation point to the council and it created a new line which you can see here since we have a little bit of space before the program executed and everything was done in 1.71 seconds and you can see that that program exited with a code of zero which is great we'll go ahead and talk about debugging in the future whenever we start using it with our own program that we end up creating instead now I'll go ahead and exit out of here and then I'll show you how to install Visual Studio through the terminal it's just as easy as doing it through the graphical interface but this is for users who don't necessarily have a graphical in faced to use in order to install visual studio and maybe want to install it on a different distribution rather than using Ubuntu so some of the ones that I've already tried are arch linux kali linux fedora and cent OS or really any distribution that has a package manager that can handle RPM packages or apt packages will be able to install Visual Studio code so it makes it a great IDE to use across various distributions of Linux so let me prepare things real quick and now the second way we're gonna install Visual Studio code is we're gonna go ahead and find the DEP package for Ubuntu here and we'll do that by using a browser in order to find Visual Studio so I think if we just type in Visual Studio code here that will find the proper package so Visual Studio code the first option here I'll put a link in the description below so we're on the HTTP colon forward slash forward slash code out Visual Studio comm and then here we can see that we have different types of packages available we can either download it for Debian Ubuntu or red hat fedora and it gives us a few more options as well as Windows and Mac OS since I'm going to boot to here I'm going to go ahead and download the dot DB extension so go ahead and use the stable version and your download should begin shortly we'll go ahead and save this file and it will go into our downloads folder it goes really quick so I'm gonna just hit show all downloads and show you that it's currently down downloaded on the computer next what I'll do is launch a terminal so let's go ahead and find terminal open that up let me make the view a little bigger for you hopefully everyone can see that and the next thing I'm gonna do is do sudo dpkg I and then I'm going to point to the package which is located in the Downloads folder so as you can see here I got sudo dpkg space - I space the location of the dot dev package and then I'll put a colon here and execute another command as well so sudo apt install so that sudo space apt space install space - F which will help install any missing dependencies that we have for this package I'll go ahead and put this command description below once you have that go ahead and press Enter I'm gonna ask you for a password put it in and give it a moment to unpack the package and install it and after everything's done running here we should have the visual studio code now installed so let's go ahead and check go ahead hit this show applications button here on the bottom left of ubuntu and then simply search for visual studio if I type it in right here there we go visual studio and launch it and welcome to your new visual studio code ID it successfully install at this point so you can go ahead and follow the instructions previously explained in the beginning of the video to show you how to use visual studio code just a little bit but at this point you are ready to go ahead and install a few extensions for visual studio code and you'll be able to run your application right away so I hope you enjoyed this tutorial on use and install visual studio code I hope you keep coming back for the rest of the series let me know if you have any questions comments or suggestions please post them in the comment section below and also make sure to subscribe for future videos and make sure to like the video thanks for watching