Compile C app with Visual Studio 2012

后端 未结 6 1452
梦谈多话
梦谈多话 2020-12-29 12:37

I plan to write application in C using Microsoft Visual Studio 2012. The problem is that I can\'t find a way to compile it right in the editor. I found this solution http:/

6条回答
  •  余生分开走
    2020-12-29 13:27

    Create an empty C++ project in Visual Studio (File -> New Project -> Visual C++ -> Empty Project), then add a source file with a .c extension to it (right click the project, select Add -> New Item -> C++ File (.cpp), and change the name of the file).

    When you build, the compiler will compile it as C code (note that Visual C++ supports only C90, not C99, so newer C language features are not usable).

提交回复
热议问题