我正在尝试使用 VS2012 执行以下操作:
文件->新建项目->Win 32 控制台应用程序。
转到属性 C/C++-> 高级并设置 Compile as C Code (/TC)
重命名源文件扩展名 cpp->c(不确定是否需要)
但无论如何项目都是像 C++ 一样编译的。
要使项目编译为 C
,还应该做些什么?
最佳答案
来自MSDN ,
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.
关于c - 如何在 Visual Studio 中创建 C(而非 C++)控制台应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24985471/