Mail Archives: djgpp/1997/10/30/07:32:18
On Wed, 29 Oct 1997, Roman Suzi wrote:
> When I renamed the program to probe.c -- the
> sizeof('\xFD') changed to 4 !!!
>
> I have never heard of such *tremendous* differences
> between C and C++.
>
> I just wonder, how much other 'subtle' differences
> there exist between C and C++ ?
This is a common misconception. Many people erroneously believe that C++
is a proper superset of C, so anything that will compile in C, will also
compile in C++ and produce identical results.
This is simply NOT TRUE. C++ is a DIFFERENT LANGUAGE; the differences
might be subtle, but they are SIGNIFICANT.
So, if you want to write a C program, call it foo.c and compile it as C
program. Do NOT call it foo.cc or foo.cpp and do NOT compile it as C++.
It might work, but it will get you in trouble one day.
Another (deliberately perverse) example of difference between these
languages can be found in section 8.3 of the DJGPP FAQ list.
- Raw text -