1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
|
The first implementation of bf(C++) was developed in the 1980s at
the AT&T Bell Labs, where the Unix operating system was created.
bf(C++) was originally a `pre-compiler', similar to the preprocessor of bf(C),
converting special constructions in its source code to plain bf(C). Back then
this code was compiled by a standard bf(C) compiler. The `pre-code', which was
read by the bf(C++) pre-compiler, was usually located in a file with the
extension tt(.cc), tt(.C) or tt(.cpp). This file would then be converted to a
bf(C) source file with the extension tt(.c), which was thereupon compiled and
linked.
The nomenclature of bf(C++) source files remains: the extensions tt(.cc) and
tt(.cpp) are still used. However, the preliminary work of a bf(C++)
pre-compiler is nowadays usually performed during the actual compilation
process. Often compilers determine the language used in a source file from its
extension. This holds true for Borland's and Microsoft's bf(C++) compilers,
which assume a bf(C++) source for an extension tt(.cpp). The i(GNU)
i(compiler) ti(g++), which is available on many Unix platforms, assumes for
bf(C++) the extension tt(.cc).
The fact that bf(C++) used to be compiled into bf(C) code is also visible
from the fact that bf(C++) is a superset of bf(C): bf(C++) offers the full
bf(C) grammar and supports all bf(C)-library functions, and adds to this
features of its own. This makes the transition from bf(C) to
bf(C++) quite easy. Programmers familiar with bf(C) may start
`programming in bf(C++)' by using source files having extensions tt(.cc) or
tt(.cpp) instead of tt(.c), and may then comfortably slip into all the
possibilities offered by bf(C++). No abrupt change of habits is required.
|