Topic: difference between C and C++?

what is the difference between C and C++? which one is best?

Re: difference between C and C++?

that information could be found on google

Re: difference between C and C++?

C++ is "C with class". C++ extend and expand C language to support object oriented programming.
Which one is the best? There is no C++ without C.

Why C++ created?
* The answer is complexity. C is the language of success but when used to build large and complex programs that would be quite difficult.
* There is a new paradigm in computer programming, it is object oriented programming (OOP).
* C does not support object-oriented programming.

If you are going to create computer programs using structured/procedural programming approach, the choice is the C. But if you are going to create computer programs using object-oriented programming approach, the choice is C++.

HTH

http://www.id-ddns.net/images/ddns-small.jpg

Re: difference between C and C++?

what about the speed? is there any difference bettwen C and C++ in the matter of speed on execution? neutral

thx for reply smile

it's my homepage: adit.co.cc | aditbalkam.co.cc

Re: difference between C and C++?

This answer is so wrong in many ways.

mustofa wrote:

C++ is "C with class". C++ extend and expand C language to support object oriented programming.
Which one is the best? There is no C++ without C.

Why C++ created?
* The answer is complexity. C is the language of success but when used to build large and complex programs that would be quite difficult.
* There is a new paradigm in computer programming, it is object oriented programming (OOP).
* C does not support object-oriented programming.

If you are going to create computer programs using structured/procedural programming approach, the choice is the C. But if you are going to create computer programs using object-oriented programming approach, the choice is C++.

HTH

> * The answer is complexity. C is the language of success but when used to build large and complex programs that would be quite difficult.

The complexity of problem does not have a correlation in which language you will use. It's true that some programming language can solve a problem in simple and less of code, but in the end it just a matter of taste, habit and the choice of speed.

Hint: X, linux, glib, gtk, vim, mplayer, and many Unix tools use C.

> * There is a new paradigm in computer programming, it is object oriented programming (OOP).

Just because C++ is come after C does not mean OOP paradigm is not recognized when C language is developed.

OOP term, as in object, is already exist when C is known as B. OOP is already implemented in Simula and Smalltalk. OOP paradigm is just got famous late, in between 1990s.

> * C does not support object-oriented programming.

I can argue with you about this, but I can see that your definition of OOP is only: "when language have a class it support OOP."

> what about the speed? is there any difference bettwen C and C++ in the matter of speed on execution? neutral

At some point yes, but the margin is just about seconds or milliseconds. But some compiler (i.e: ICC) can generate faster C++. The only difference is memory consumption, C++ tend to consume more memory than C.

For OP, read these http://en.wikipedia.org/wiki/Compatibil … nd_C%2B%2B .

Re: difference between C and C++?

shuLhan wrote:

This answer is so wrong in many ways.

Are you sure?

shuLhan wrote:
mustofa wrote:

Why C++ created?
* The answer is complexity. C is the language of success but when used to build large and complex programs that would be quite difficult.
* There is a new paradigm in computer programming, it is object oriented programming (OOP).
* C does not support object-oriented programming.

The complexity of problem does not have a correlation in which language you will use. It's true that some programming language can solve a problem in simple and less of code, but in the end it just a matter of taste, habit and the choice of speed.

Hint: X, linux, glib, gtk, vim, mplayer, and many Unix tools use C.
--
Just because C++ is come after C does not mean OOP paradigm is not recognized when C language is developed.

OOP term, as in object, is already exist when C is known as B. OOP is already implemented in Simula and Smalltalk. OOP paradigm is just got famous late, in between 1990s.
--
I can argue with you about this, but I can see that your definition of OOP is only: "when language have a class it support OOP."

The complexity of the problem actually is the basis of new paradigm in programming (OOP). Bjarne Stroustrup makes C++ to solve the problem. Please read the book "The C++ Programming Language" written by him.
Selection of programming languages, the most important is not a matter of taste, habit and choice of speed but the ability of the programmers on a programming language that will be used.

About the development of C, you do not need to worry. C is not marginalized by the C++. I said "C++ extend and expand C language to support object oriented programming."

This is a discussion forum in cyberspace. Answering something unnecessary details. To know the difference between C and C++ please read their own books written by the creator of both languages​​.

* Brian W. Kernighan & Dennis M. Ritchie: The C Programming Language
* Bjarne Stroustrup: The C++ Programming Language

HTH

http://www.id-ddns.net/images/ddns-small.jpg