开发者

whats the difference between c compiler and c++ compiler of microsoft c/c++ compiler?

  1. I could compile the void main() as c++ source file with microsoft c/c++ compiler 14.00 (integrated with visual studio 2005).So does it means that the compiler does not conform to the c++ standard on the main function prototype?

  2. Is the microsoft c/c++ compiler only one compiler,that is,it is only one c++ compiler?Because C source file could be compiled as C++ source file,so its no need to develop the c 开发者_如何学Gocompiler anymore?

    thanks.


I could compile the void main()

The valid signatures of main are:

int main(void); // no parameters 
int main(int, char **); // parameterized

Everything else is not standard. The standard does allow an implementation to allow alternate signatures of main().

Is the microsoft c/c++ compiler only one compiler,that is,it is only one c++ compiler?

Yes, it is one executable (cl.exe). However, it can work either as a C compiler or a C++ compiler. The default is C++ compiler mode. You can change this by going into Project Properties > C/C++ > Advanced (/TP or /TC)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜