C++ and ANSI C
Daniel E. Wilson
danw at tekchips.LABS.TEK.COM
Fri May 5 07:02:48 AEST 1989
In article <1989May4.001911.3382 at utzoo.uucp>, henry at utzoo.uucp (Henry Spencer) writes:
> In article <44100029 at hcx2> daver at 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, ..."
>
> 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
> --
Number 1 is incorrect since C++ uses '...' to indicate that the number
and type of arguments is unknown. The void keyword in ANSI C indicates
that the function takes no arguments. No arguments in the prototype in
C++ means that there are no arguments.
Number 2 is correct since the struct and union concepts in C++
are subsets of the class concept. The class concept requires that
a class be a new data type.
Dan Wilson
More information about the Comp.lang.c
mailing list