PureBytes Links
Trading Reference Links
|
As someone who is expert in C and C++ (using the latter since 1989),
and who has also programmed in Pascal, PL/I, Fortran, Algol, Basic,
various assembler languages, and a few others, I have a few comments:
1. Although C++ is mostly derived, from C, C is not exactly a subset of C++,
in that certain language differences exist that could cause a C program to
fail to compile under a C++ compiler, or to produce different results.
For example, the following shows code is valid in C, but not C++:
typedef enum { R,G,B } RGBColor ;
typedef enum {Red, Orange, Yellow, Green } SpectrumColor;
RGBColor rgb1 = R ;
SpectrumColor spc1 = rgb1 ; /* Valid in C, but not in C++ */
void f(){}
f( a,b,c ); /* valid in C, but not in
C++ */
2. Precisely because C++ is object-oriented, it may be better to learn it
first,
to avoid the non-object mind set. This is rather like the way some people learn
to swim; if they start by bending their knees for the flutter kick, it is
usually more
difficult for them to relearn the kick, which is properly done without such
bending.
David Miller
Consultant
At 6/6/99 09:00 AM Sunday, The Omega Man wrote:
>C is a subset of C++. All C is C++ by definition. (However, all C++ is not
>C, of course.)
>
>I'd avoid the object-oriented languages (like C++) if you are just getting
>started.
|