Microsoft Visual C ++ Express编译器是否编译C代码?

时间:2022-06-07 03:14:25

I'm not sure, will the visual c ++ compiler express edition work for compiling c and if not can someone link me to an easy c compiler to use. Thanks in advance.

我不确定,visual c ++编译器表达版本是否可用于编译c,如果没有,有人可以将我链接到一个简单的c编译器来使用。提前致谢。

6 个解决方案

#1


4  

Yes, it will work. C is a subset of C++ (for all but a very small number of exceptional cases). Any C++ compiler should work with valid C code.

是的,它会起作用。 C是C ++的一个子集(除了极少数特殊情况外)。任何C ++编译器都应该使用有效的C代码。

See the answers to this question for some of the rare examples of C code that isn't valid C++.

有关C代码无效C ++的一些罕见示例,请参阅此问题的答案。

#2


6  

To add to Bill The Lizard's answer - any C++ compiler will compile a file using C language rules if the file has a .c extension. This can be overriden to force a file to be compiled as C or C++ using command line options.

添加到Bill The Lizard的答案 - 如果文件具有.c扩展名,任何C ++编译器都将使用C语言规则编译文件。可以重写此操作以强制使用命令行选项将文件编译为C或C ++。

This is done with MSVC using the /Tc or /TC options to compile as C, and the /Tp or /TP options to compile as C++.

这是通过MSVC使用/ Tc或/ TC选项编译为C,/ Tp或/ TP选项编译为C ++完成的。

#3


2  

You can download a free copy of the Digital Mars C compiler.

您可以下载Digital Mars C编译器的免费副本。

#4


1  

http://www.bloodshed.net/compilers/index.html

maybe there's something to your liking there.

也许那里有你喜欢的东西。

also there's always gcc: http://gcc.gnu.org/

也总是有gcc:http://gcc.gnu.org/

#5


0  

Depends partly on what C you're talking about. Visual C++ will happily compile C programs (make sure they've got a .c extension, and make sure the "Compile As" option in the "Advanced" part of the "C/C++" property pages is not set to C++ only), but is missing a whole lot of stuff in the C99 standard. If you're interested in the original standard C, Visual C++ will work very nicely.

部分取决于你在说什么C。 Visual C ++将很乐意编译C程序(确保它们有.c扩展名,并确保“C / C ++”属性页的“高级”部分中的“编译为”选项不仅设置为C ++) ,但缺少C99标准中的很多东西。如果您对原始标准C感兴趣,那么Visual C ++将非常有效。

#6


0  

Just small clarification - Visual C++ is not a compiler rather an IDE. The compiler will be cl.exe and as many sad there is no problem to compile C code with cl.
But there is other options like Windows ports of gcc or Watcom compiler

只是一点点澄清 - Visual C ++不是编译器而是IDE。编译器将是cl.exe,并且很多人用cl编译C代码没有问题。但还有其他选项,如gcc的Windows端口或Watcom编译器

#1


4  

Yes, it will work. C is a subset of C++ (for all but a very small number of exceptional cases). Any C++ compiler should work with valid C code.

是的,它会起作用。 C是C ++的一个子集(除了极少数特殊情况外)。任何C ++编译器都应该使用有效的C代码。

See the answers to this question for some of the rare examples of C code that isn't valid C++.

有关C代码无效C ++的一些罕见示例,请参阅此问题的答案。

#2


6  

To add to Bill The Lizard's answer - any C++ compiler will compile a file using C language rules if the file has a .c extension. This can be overriden to force a file to be compiled as C or C++ using command line options.

添加到Bill The Lizard的答案 - 如果文件具有.c扩展名,任何C ++编译器都将使用C语言规则编译文件。可以重写此操作以强制使用命令行选项将文件编译为C或C ++。

This is done with MSVC using the /Tc or /TC options to compile as C, and the /Tp or /TP options to compile as C++.

这是通过MSVC使用/ Tc或/ TC选项编译为C,/ Tp或/ TP选项编译为C ++完成的。

#3


2  

You can download a free copy of the Digital Mars C compiler.

您可以下载Digital Mars C编译器的免费副本。

#4


1  

http://www.bloodshed.net/compilers/index.html

maybe there's something to your liking there.

也许那里有你喜欢的东西。

also there's always gcc: http://gcc.gnu.org/

也总是有gcc:http://gcc.gnu.org/

#5


0  

Depends partly on what C you're talking about. Visual C++ will happily compile C programs (make sure they've got a .c extension, and make sure the "Compile As" option in the "Advanced" part of the "C/C++" property pages is not set to C++ only), but is missing a whole lot of stuff in the C99 standard. If you're interested in the original standard C, Visual C++ will work very nicely.

部分取决于你在说什么C。 Visual C ++将很乐意编译C程序(确保它们有.c扩展名,并确保“C / C ++”属性页的“高级”部分中的“编译为”选项不仅设置为C ++) ,但缺少C99标准中的很多东西。如果您对原始标准C感兴趣,那么Visual C ++将非常有效。

#6


0  

Just small clarification - Visual C++ is not a compiler rather an IDE. The compiler will be cl.exe and as many sad there is no problem to compile C code with cl.
But there is other options like Windows ports of gcc or Watcom compiler

只是一点点澄清 - Visual C ++不是编译器而是IDE。编译器将是cl.exe,并且很多人用cl编译C代码没有问题。但还有其他选项,如gcc的Windows端口或Watcom编译器