How to start a C project in VS 2015
Solution 1
Create a visual c++ project.
Just rename your source file from .cpp to .c
No special conversions required. Just type your valid c code and it will compile just fine.
Solution 2
You can either do as Douglas DeTellem has suggested (Simply start a C++ project, change the extension to ".c", and just use their C++ compiler (C++, is of course, a superset of C), or you can try downloading MinGW (http://www.mingw.org/) and installing the Windows version of gcc, which supports the old C standard.
If you really want an IDE, try looking at Codeblocks (http://www.codeblocks.org). If you pick the download with MinGW, it will include the C compiler, and help you.
I tend to prefer using a text editor (in my case, gVim) and using a command prompt to run gcc, or cl (the Visual Studio command line call to the compiler and linker) to compile my programs.
Tony Tannous
I am a computer science student. Courses I liked: Data Structures. Advanced Data Structures. Image Processing.
Updated on June 18, 2022Comments
-
Tony Tannous almost 2 years
I have Visual Studio 2015, and I was wondering if it supports C.
I press on "New Project" and the options are Visual C#, Visual C++, Visual Basic.
I was wondering if I could compile a C programm or do one in VS. Does it have a C compiler ?
I am lost.
Thanks in Advance.
-
too honest for this site about 8 yearsYou cannot compile standard compliant code with MSVC. That compiler does only support the much outdated and not standard C90 version.
-
-
IInspectable about 6 yearsC++ is not a superset of C. C and C++ are different programming languages. A valid C program is not necessarily valid C++, e.g.
char* p = malloc(42);
- being valid C code - will not compile as C++. Visual Studio does come with a C compiler, though. As far as I know, it doesn't (fully) support C99 or C11.