L
Lew Pitcher
This may be a FAQ, but I did some searching and did not find an answer
that satisfied me.
I seem to remember people on this group claiming strongly that despite
their similarities, C and C++ are two different languages, and are
best treated as such.
Yes, both assertions are true.
C and C++ each have their own language definition, individually standardized
by both national and international standards bodies. It is not difficult to
locate copies of these standards documents, and a comparison of them will
show that C and C++ are two different languages, similar only in a small
subset.
Can anyone point me to a summary of the differences between these two
languages,
While I don't consider Wikipedia the best source of information, their web
page on the subject /does/ have a fair amount of accurate information:
http://en.wikipedia.org/wiki/Compatibility_of_C_and_C++
and also to information about the possible consequences of e.g. compiling
one language in a compiler intended for the other?
(Obviously, much of C++ will not compile at
all in a C compiler. That is not the interesting part.)
AFAIK, the consequences of using the wrong compiler are not defined by
either standard. Some compilers will happily compile C as C and C++ as C++,
while others will make some compiler-specific assumptions. In general, the
consequences of using the wrong compiler is that the resulting executable
program (if such is the result) may not generate the results expected of
it. Further specifics depend on the compiler, the level of the language
that it compiles, the code given to it to compile, and the expertise of the
programmer (or programmers) who wrote it (obviously, badly written code may
not compile, or may compile incorrectly, no matter which compiler is used).
HTH