C programming in Visual Studio

HelloWorld picture HelloWorld · Dec 29, 2013 · Viewed 359k times · Source

Can I use Visual Studio to learn C programming? In the new project menu I can choose between Visual Basic, Visual C#, Visual C++, Visual F# and others but I don't see "C" or "Visual C".

Answer

72DFBF5B A0DF5BE9 picture 72DFBF5B A0DF5BE9 · Dec 29, 2013

Short answer: Yes, you need to rename .cpp files to c, so you can write C: https://msdn.microsoft.com/en-us/library/bb384838.aspx?f=255&MSPPError=-2147217396

From the link above:

By default, the Visual C++ compiler treats all files that end in .c as C source code, and all files that end in .cpp as C++ source code. To force the compiler to treat all files as C regardless of file name extension, use the /Tc compiler option.

That being said, I do not recommend learning C language in Visual Studio, why VS? It does have lots of features you are not going to use while learning C