Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Yea, after looking into it they don't seem to be completely compatible anymore. I have known many people to use a C++ compiler when writing C code, but it looks like that restricts you to a subset of C.

They do try and stay reasonably consistent so for example Long Long moved from C to C++. And C99 has reduced some other incompatibilities by incorporating C++ features such as // comments and mixed declarations and code.

http://en.wikipedia.org/wiki/Compatibility_of_C_and_C%2B%2B



"I have known many people to use a C++ compiler when writing C code, but it looks like that restricts you to a subset of C."

Many C++ compilers actually are C/C++ compilers that decide what language to compile depending on command line flags and/or file name extension.


Ahh, ok now that explains a lot, thanks.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: