Visual Studio Code

RAHIT

Estimable
Jul 19, 2014
3
0
4,510
I want to do some C programming on visual studio code. What things I need to set up on VS code so that I can do C programming. A task.json file I found on the internet was like this:
{
"version": "0.1.0",
"command": "g++",
"isShellCommand": true,
"showOutput": "always",
"args": ["-g", "main.cpp"]
}
How should my task.json file look like for C programming?
 

shrapnel_indie

Distinguished
Jan 21, 2010
68
0
18,610
Since C is a subset of C++, you shouldn't need to do anything else other than change "main.cpp" to "main.c." Other than that, set up Visual Studio Code for using C++. It uses pretty much the same compiler (in this case g++) regardless. Just be aware that as of 9/7/2016, C++ support is still under development and therefore, by extension, so is C support. You may run into some glitches here and there.
 
Visual Studio Code is NOT an IDE, it's just a text editor. You are still supposed to have compiler toolchain installed on your computer in order to produce it.

For the moment - get some easy-to-use IDE, the one I'm using is CodeBlocks (available in most current Linux distro's). You will still have to install gcc and c++, but the IDE wlll let you compile and debug without leaving it.
 

shrapnel_indie

Distinguished
Jan 21, 2010
68
0
18,610


I will agree with the Code::Blocks suggestion. It is a full IDE and cross-platform. It capable of using any one of multiple compilers (MinGW, G++ are two cross-platform compilers. On Windows it can use the VS compilers, or even Borland Compilers in addition to those two. I believe it supports more than that on all platforms too.) PLUS Code::Blocks resides on your computer, not in the cloud, so if you are having internet issues, it will not suffer.