是否有可能编译pre-ANSI(K&安培; R式)C code用Visual C ++? [英] Is it possible to compile pre-ANSI (K&R-style) C code with Visual C++?
本文介绍了是否有可能编译pre-ANSI(K&安培; R式)C code用Visual C ++?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我们有一些旧的C code。与pre-ANSI(K&安培; R样式)函数声明。例如:
We have some old C code with pre-ANSI (K&R-style) function declarations. For example:
int foo(x, y)
double x, y;
{
/* do some stuff */
}
有没有编译器开关,以便在Visual C ++ 2008支持这个功能?
Is there a compiler switch to enable support for this in Visual C++ 2008?
推荐答案
为了得到这个编译把code在.c文件与一个.cpp。这指示的Visual Studio编译code为C,而不是C ++
In order to get this to compile put the code in a .c file vs. a .cpp. This instructs Visual Studio to compile the code as C instead of C++
这篇关于是否有可能编译pre-ANSI(K&安培; R式)C code用Visual C ++?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文