gpt4 book ai didi

c - 在 VS2010 上用 Visual C++ 编写 C 代码

转载 作者:太空狗 更新时间:2023-10-29 17:21:48 25 4
gpt4 key购买 nike

我很欣赏差异可以忽略不计,但我正在做一些数字运算,所以我想使用 C。我刚刚在 VS2010 中创建了一个项目,选择了一个 C++ 项目并编写了一些 C。所有执行都很好,但是

这是在快速(更)C 编译器或 C++ 中创建和执行的,因为它是一个 C++ 项目吗?

我如何指定我希望编写的代码实际上是 C 代码并作为 C 编译和运行?

最佳答案

Visual Studio C++ 编译器会将所有 .c 文件视为 C 语言文件并按 C 语言文件进行编译。

附加引用:

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.

http://msdn.microsoft.com/en-us/library/bb384838.aspx

关于c - 在 VS2010 上用 Visual C++ 编写 C 代码,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4061127/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com