Lindsay wrote:
I was just reading another post when someone commented that the code was C
and not C++. What are the differences? (Examples?) The answer does not
affect my programming but would help to know if I need to post a question.
C was invented by Dennis Ritchie in the 1970s.
C++ was invented by Bjarne Stroustrup in the 1980s.
C++ was created as a successor to C. The _main_ difference is support
for object-oriented programming, but there are a number of feature
changes. Quite some detail is gone into here:
http://en.wikipedia.org/wiki/C%2B%2B
It's quite common to describe C++ as a superset of C; this isn't exactly
true:
- a C program may use C++-specific reserved words as identifiers
- some obsolete syntaxes are not part of C++, such as the old way of
specifying the types of function parameters
- some features that were added in C99 have not yet made it into a C++
standard.
Of course, a C program can be, and often is, also a valid C++ program.
However, if it doesn't use any of the features specific to C++, then
it's rather meaningless to call it a C++ program. My guess is that what
whoever it was meant is that a snippet of code that somebody posted
doesn't use any C++-specific features, and as such can be considered
plain C, and therefore more appropriate for comp.lang.c than here.
Maybe if you would care to supply an example, somebody can clarify further.
Stewart.
--
-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCS/M d- s:- C++@ a->--- UB@ P+ L E@ W++@ N+++ o K-@ w++@ O? M V? PS-
PE- Y? PGP- t- 5? X? R b DI? D G e++>++++ h-- r-- !y
------END GEEK CODE BLOCK------
My e-mail is valid but not my primary mailbox. Please keep replies on
the 'group where everyone may benefit.