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

preview_player
Показать описание
Welcome to the channel! In this video, we will explore how to set up Visual Studio Code for writing and executing C and C++ programs. To proceed, you need to download and install the latest version of VS Code on your computer, as well as a C/C++ compiler or toolset. If you need help with this step, tutorials are available here.

Download and Install Mingw

Download and Install Visual Studio Code

Once VS Code and the compilers are installed, we can set up the VS Code workspace.

First, we will create a workspace for C/C++ programming by saving it in a designated folder on the desktop. Inside this workspace, we will create individual folders for different projects. For our example project, we will create a folder named "hello" to display a simple "Hello World" text on the screen using a C program.

After setting up the workspace, we will add a new file named "hello. c" to start writing our C program. Before proceeding, we will install essential extensions for C/C++ development. This includes the C/C++ extension and the C/C++ extension pack. These extensions provide features like IntelliSense, debugging, and code browsing. Once installed, we will close the extensions tab and welcome window.

Now, we can write a basic C program that includes stdio. h header file, main function returning 0, and a printf statement to display "Hello World" text. After saving the program, we can run it by selecting the C/C++ tool chain option. The terminal window will show the output of the program, confirming its successful execution.

To enhance the program, we can modify it to take user input for their name and display a personalized message using scanf and printf functions. After making the changes, we can run the updated program to see the new output.

If you encounter any issues or have feedback, feel free to leave a comment. Thank you for watching, and stay tuned for more videos on programming with VS Code!

Setup Visual Studio code for Python Programming

Our Website

Social Media
Рекомендации по теме
Комментарии
Автор

Thank youu brother, been trying for 2 days now to setup and have watched multiple videos, this one worked for me!

taimoorrafi
Автор

I am not getting the c/c++ gcc.exe build and debug active file .... I had already installed the extensions

allenjosephbabu
Автор

Is there any way for me to get ride of the long text in the terminal that shows up before the output shows?

supermarketdave
Автор

The problem is it cannot use cin/input

_kalabasaa
Автор

Build finished with error while executing the second program

pavithran
Автор

Title is misleading. " How to Set up Visual Studio Code for C and C++ Programming" Then you say you you need to install other things to even watch this video. That's bs. Change the title or fix the content.

gravityowns