[nzlug] Whats The differance between

Matthew Diesch mdiesch at gmail.com
Tue Oct 17 14:52:00 NZDT 2006


Fairy nuff, but if you want to describe the difference between C and C++ in
one line then it's hard to go past the OO superset description. If you have
to ask then chances are that's all the answer you're after.

On 17/10/06, anru chen <ctx2002 at gmail.com> wrote:
>
> man, your guys must living in past, c++ is not a super set of c, it a
> totally different language. if you want to learn c++ programming, pick
> up a modern book, better produced after 2002, since many old style c++
> book just added class to C.
>
> learning how to progrmming in c++ is very confusing, and many people
> will quickly write c++ in c ,  like me :)
>
> anru
>
> On 10/17/06, Daniel Pittman <daniel at rimspace.net> wrote:
> > brendon <brendontoogood at gmail.com> writes:
> >
> > > Hi there all, What is the difference between C and C++
> > > As I have found a book on C++
> >
> > C++ originated as a set of extensions to C to add easier object oriented
> > programming constructs to the language, and to formalize a number of C
> > language OO development clichés into a simpler, easier to understand
> > format.
> >
> > Since then C and C++ have developed significantly and diligently, so
> > that C99 and the latest C++ are almost entirely different languages.
> >
> > The heart of "almost C" compatibility still beats inside C++, but not so
> > strongly as it once did.  The addition of Turing complete template
> > metaprogramming[1] language and namespace extensions have moved it into
> > a completely different field.
> >
> > Meanwhile C99 standardizes incompatible facilities and data types with
> > C++, ensuring that a C99 compliant C program isn't entirely
> > C++-as-a-better-C compatible.
> >
> >
> > Both languages have some degree of commonality though.  They share the
> > same deep down base infrastructure of being a "portable assembly
> > language," and demand that developers understand the low level hardware
> > architecture to work effectively.
> >
> > They are both weak static typed languages, with C++ being more strictly
> > statically typed -- especially between translation units -- than C is.
> >
> > Both are definitely weakly typed, and one of the commonest problems they
> > have is that weak typing leads to insecure code, data corruption and
> > incoherent faults.  Both demand manual memory management[2].
> >
> > Regards,
> >         Daniel
> >
> > Footnotes:
> > [1]  The "Turing complete" property of C++ templates was an accident
> >      and, in my opinion, the routine use of it is one of the worst
> >      decisions the C++ community have made.
> >
> > [2]  C++, with templates, addresses this somewhat by generating code on
> >      demand to perform simple automated memory management.  Both
> >      languages can also have garbage collection grafted on, but neither
> >      does so well.
> >
> > --
> > Digital Infrastructure Solutions -- making IT simple, stable and secure
> > Phone: 0401 155 707        email: contact at digital-infrastructure.com.au
> >                  http://digital-infrastructure.com.au/
> >
> > _______________________________________________
> > NZLUG mailing list NZLUG at linux.net.nz
> > http://www.linux.net.nz/cgi-bin/mailman/listinfo/nzlug
> >
>
> _______________________________________________
> NZLUG mailing list NZLUG at linux.net.nz
> http://www.linux.net.nz/cgi-bin/mailman/listinfo/nzlug
>



More information about the NZLUG mailing list