Newsgroups: comp.lang.c Path: utzoo!henry From: henry@utzoo.uucp (Henry Spencer) Subject: C++ and ANSI C Message-ID: <1989May4.001911.3382@utzoo.uucp> Organization: U of Toronto Zoology References: <12005@paris.ics.uci.edu> <44100029@hcx2> Date: Thu, 4 May 89 00:19:11 GMT In article <44100029@hcx2> daver@hcx2.SSD.HARRIS.COM writes: >From "Computerworld" (4/24/89, p. 31): > "... A key selling point of C++ is its relationship with the established C > language. It includes ANSI-standard C as a subset, as does Objective C, ..." > >Perhaps statements like the above cause the confusion... Quite likely, since they're not true. There are a couple of fundamental incompatibilities between C++ and C (ANSI or not), plus a number of minor ways in which ANSI C differs from C++ in areas where they overlap. Most of the latter will go away when Bjarne's crew gets the new official C++ reference manual out the door, but at the moment ANSI C is *not* a subset of C++, even if you ignore the big incompatibilities. Computerworld, as usual, basically doesn't know what it's talking about. To break the suspense, the two big incompatibilities are: 1. "extern foo();" means (so to speak) "extern foo(...);" in ANSI C and "extern foo(void);" in C++ 2. declaring a struct or union tag in C++ essentially does an implicit typedef on that identifier as well -- Mars in 1980s: USSR, 2 tries, | Henry Spencer at U of Toronto Zoology 2 failures; USA, 0 tries. | uunet!attcan!utzoo!henry henry@zoo.toronto.edu