Seems all compilers can deal with both c and c++,like gcc ,msvc…
Is it because these 2 languages are exactly very much alike?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Actually, GCC (GNU Compiler Collection) has two different front-ends,
gccandg++. To specify C++, you can also use a .cpp (or a few others) extension, or-x c++, when executinggcc. However, this requires extra options (like linking in the C++ standard library).cl, Microsoft’s C++ compiler, does not support modern C. However, it will compile C source files as a variant of C89, and you can specify this explicitly with/TC.For both, you are correct that there’s a lot of shared code, regardless of which front-end is used (GCC also has many more). However, the languages do have significant differences, which are discussed elsewhere (this question among others).