Looking at the chart on the wall C was incrementally developed from
BCPL that came from CPL.
in the 1970's we had K&R C, the first definition.
ANSI/ISO C was standardised in 1989/90 and then ISO C in 95 and 99
C++ was developed from "C with Classes" (1980) which was developed
from 1975 K&R C AND Simula 68
And C with Classes was originally intended to be no more than an
extension to C, a concept that never ceased to influence the development
of C++, even long after it had diverged enough that it was clearly a
different language.
C++ came about in 1985 ish with influences from Algo 68 and additional
input from Simula 68
And it was developed with an explicit design philosophy, which
influenced a great many of the design decisions, to maintain a fair
amount of backwards compatibility with C. In fact, there's been a lot of
criticism of precisely those design decisions which were made to retain
a level of backwards compatibility.
So there is a LOT of Simula in C++ as well as Algo
Moving on... in 1990 we had C++ ARM,( Annotated Reference Manual not
ARM MCU's ) developed from C++ but also with influences from Ada, ANSI
C, ML and CLu
C++ was further developed into the mid 90's when it became an ISO
standard.
And the C and C++ committees interacted strongly, with the goal of
avoiding gratuitous incompatibilities between C and C++.
So whilst sharing syntax that appears similar C and C++ diverged in
197* and whilst C carried on in one direction C++ was a hybrid of C and
Simula which was developed independently from C with influenced from 5
other languages.
To summarize my comments on your history: C++ didn't just diverge wildly
from C randomly; it was deliberately kept fairly close to C, far closer
than it would have been had there not been a deliberate decision to
retain a fair amount of C compatibility. C is NOT just a language that
inspire the design of C++, the connections between the two languages are
much tighter than that.
The confusion generally arises because in the early days (from memory)
a front end call C-Front was used to translate C++ into C for
compilation until C++ compilers were built from scratch.
Thus the myth started that C++ was a super set of C.
I doubt that awareness of that historical background has as much to do
with that "myth" as other, more important things, such as the following
list of similarities, which I'll organize by sections of the C standard:
6.4.1: Virtually every C90 keyword is also a C++ keyword, and when used
in typical C code, most of them have essentially the same meaning as in
C++. Also, many of the new C90 keywords are also keywords in C++03.
6.4.2: The rules for legal identifiers in C are almost identical to
those of C++.
6.4.3: UCNs work essentially the same in both languages.
6.4.4: Most C90 constants are C++ literals, almost always with the same
meaning (the biggest difference being the type of 'a').
6.4.5: string literals are pretty much the same in both languages,
except that they are const-qualified in C++, but they're not safely
writable in either language, so that won't have much effect on
well-written C code.
6.4.6: Every C punctuator is also a C++ punctuator.
6.4.7: Both languages have essentially the same rules for header names.
6.4.8: Both languages have essentially the same rules for preprocessing
numbers.
6.4.9: Every C90 comment is also a C++ comment; and C99 comments are
essentially the same as C++ comments.
6.5: Every C90 expression is also a C++ expression, and when used in
typical C code, almost always has the same meaning in C++.
6.6: All C constant expressions are also C++ constant expressions.
6.7: Most C declarations carry essentially the same meaning in C++,
though there are some changes the scope and name space rules.
6.8: Every C statement type is also a C++ statement type. While some of
the details are different in C++, in typical C code, they work the same
way in both languages.
6.10: Preprocessing directives: every C90 preprocessing directive is
also a C++ preprocessing directive, with essentially the same meaning.
7: The entire C standard library was incorporated with only a few
modifications into the C++ standard library. While things like <cstdio>
and std:
rintf do exist, you don't have to use them: <stdio.h> and
printf() will work almost exactly as they do in C.
I put this list together in a hurry - some of my "almost" and
"essentially" qualifiers may have been unnecessary, and I may have
failed to use them on some statements where they were needed - but I'm
sure that I didn't make enough errors in the above summary to change my
final conclusion:
The concept that C is a strict subset of C++ is indeed a myth, but
mainly because of the word "strict". The concept that C doesn't even
come close to being a subset of C++ is a myth that strays much farther
from the truth.