Hey there.
First of all, that isn't Visual Studio. That's Visual Studio Code, which isn't a full-fledged IDE. If you're working with VSCode, you'll have to download a crap ton of extensions and do some of your own configuring to get a language like C++ working. And to be honest, I wouldn't go through the bother of doing all of that.
If you're going to be writing C or C++ code on Windows, download an IDE like Code::Blocks or Visual Studio. For Code::Blocks, you'll need to set-up a utility called MinGW, which will grant you the ability to compile C and C++ programs on Windows. Visual Studio on the other hand, comes with its own C++ compiler, so you won't have to do any configuring of your own(When you do install Visual Studio, I believe that you need to download the C++ extension for it. I can't remember as I don't use Visual Studio anymore).
For MinGW, as stated, you're going to have to set it up yourself. That includes installation and setting-up the PATH variables. There are tutorials online on how to set this all up, so I won't be going over it. When you have set-up MinGW, you will have GCC(GNU Compiler Collection) installed then. This gives you access to both gcc
for C files and g++
for C++ files. Again, this is only after you've set-up MinGW.
Once you're done setting it up and you've got it assigned to your PATH variables, you should now be able to compile your code. If you use Code::Blocks, then you'll need to assign the compiler to Code::Blocks. Again, there are tutorials on how to do that. Visual Studio, again, comes with its own compiler.
If you're on an OS X system, it should have came with Apple's own Clang compiler. Try opening-up a terminal and use Clang to compile your C++ file. There are tutorials online on how to use Clang, so search up on how to use it.
If you're on a GNU/Linux system(Such as Debian, Ubuntu, Fedora, etc.) then it will have definitely came with GCC. This comes with both a C and a C++ compiler. For C, you just use: gcc <filename.c>
. For C++, you use: g++ <filename.cpp>
. GCC is quite powerful, so if you are on GNU/Linux, use it. Plus, it comes pre-installed, so you won't have to download anything. You'll just get periodic updates every so often, so be sure to apply those updates too.
Hope this helps.