简体   繁体   中英

How to compile C program in Visual Studio Code?

I installed VSC and wrote this program

#include <stdio.h>

int main( void )
{
    printf("Hello world!");
}

Then I installed a C/C++ debugger and I saved the file on the desktop as "hello.c" and magically the syntax became higlighted.

Now I would like to run the program, but can't find a way.
There's no "run" or "build" option anywhere, and if I start the debugging and choose the debugger then I got a new tab named "settings.json" with a couple of brackets waiting for me to write something.

Also in the left I can read that I "have not yet opened a folder". What does it even mean?

And the line #include <stdio.h> is underlined in red, like there's something wrong going on, maybe I have to download the library?

I would do anything to see the output of the program, please help me.

have you added c/c++ and code runner extensions?

I installed VSC and wrote this program

#include <stdio.h>

int main( void )
{
    printf("Hello world!");
}

Then I installed a C/C++ debugger and I saved the file on the desktop as "hello.c" and magically the syntax became higlighted.

Now I would like to run the program, but can't find a way.
There's no "run" or "build" option anywhere, and if I start the debugging and choose the debugger then I got a new tab named "settings.json" with a couple of brackets waiting for me to write something.

Also in the left I can read that I "have not yet opened a folder". What does it even mean?

And the line #include <stdio.h> is underlined in red, like there's something wrong going on, maybe I have to download the library?

I would do anything to see the output of the program, please help me.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM