the screenshot shows what the empty field and the code writtenI have just set up VS Code for programming with C, I installed all the necessary things (gcc, gdb..etc) But when I started writing basic code, vs code shows an empty output after I run it
CodePudding user response:
Installation (Ignore if installed)
Windows
Install mingw/gcc/clang compiler and then add it to the path.
GNU/Linux
Install gcc/clang compiler using your package manager.
Arch Based Distros: `sudo pacman -S gcc`
Ubuntu/Other debian based distro: `sudo apt install gcc g `
Now, install C/C extension for VSCODE here's the link C/C extension
Installing the C/C VSCODE extenion
Or you can directly install it through Ctrl Shift P and paste this snippet ext install ms-vscode.cpptools.
Compiling
Now, open your terminal in VSCODE and run gcc Test.c -o test and then run ./test to execute your program.
Or, if you have installed clang compiler then the terminal command goes here clang Test.c -o test and then run ./test to execute your program.
CodePudding user response:
Main method have return type int, try return 0; after printf. Or you need to add argument to main method, in java program i know we can not run program without argument. Or Try make void main method
