Introduction to VSCode

Last updated on 2024-03-12 | Edit this page

Overview

Questions

  • How do you create new C++ file in VSCode?

Objectives

  • Explain how to open and save new files
  • Demonstrate how to create your own C++ file

Before we get started we must understand how the code editor works. First start by opening a new file. You can do so by going to File->New File or using the keystrokes ctrl + n or command + n (on mac). You can do this for whenever you want to open a new file.

Extensions

We want to also download Microsoft’s C++ extensions as it will make debugging/coding a lot simpler. Go to the left side-bar and look for this icon:

Extension

Go to the search bar and look up C++. Now install the first extension that pops up. This extension will allow the code editor to scan your code for any potential errors and help you spot it before you run the code.

Now in your new file save it as Intro.cpp. It is important to note that the “.cpp” extension is what makes the file a “C++” file. With that, you are ready to write your first line of C++ code.

Key Points

  • Use the .cpp extension to properly label your files as a C++ file
  • Use VSCode’s navigation system or keyboard shortcuts to create new files