C programming in Visual Studio

后端 未结 6 1600
醉话见心
醉话见心 2020-11-29 17:14

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\"

6条回答
  •  无人及你
    2020-11-29 17:57

    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

提交回复
热议问题