English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

11 answers

it is about the same kind of difference as between chinese and korean...
Both use letters, and are understood by computers. But the syntax, lexic and vocabularies are different.
Helps?

BTW, one being "oops", and the other one not is really bull... Create a struct in "C", shove some pointers to functions into it, and enjoy your very own "object".
Now, create another struct, with the previous one as the first field - and you have just discovered inheritance. Cast a pointer to the second one into a pointer to the first - and that is your polymorphism.

Another myth is that C++ is a "superset of C" or that you can compile a C program with a C++ compiler. This is not true. They look somewhat similar to a human eye, but formally are totally different laguages.
You could, probably, come up with some fairly simple C program, that can be compiled with C++, just like some Spanish words (and even sentenses) are also valid in French, but in general that is not true.
Function pointers are not compatible with void*, or with each other. Integers are not compatible with pointers, and are not assumed by default, you can't skip a type declaration etc, etc.

And finally, no, "C" is not faster than "C++" on any sane system.

2006-10-19 04:14:45 · answer #1 · answered by n0body 4 · 0 0

C++ expands upon the C language. There is support for the Object Oriented Programming language extension, and there are other small changes. Some of the changes are for support of OOP, however you can take advantage of the C++ language improvements without using OOP.

Just some of the C++ improvements over C:
-C uses more cumbersome comment markers (/* */), while C++ uses the double forward slash (//).
-Variable scope is another improvement.
In C, you cannot access 2 variables of the same name (local & global), but with C++, you can.
-Function overloading. C does not allow functions to have the same name. C++ allows this, provided that the parameters are different. This allows a programmer to make a set of procedures which are similar in function, but require different parameters or types of parameters.

I don't think anyone uses a straight C compiler for programming anymore, unless they're using something old for learning C. It is best to use a C++ compiler and take advantage of it's extended capabilities. Only don't use OOP. It's just bloated, slow code for lazy people.

2006-10-19 03:46:36 · answer #2 · answered by Balk 6 · 0 1

The main difference between C & C++ is the OOPS technology, C++ is an object oriented programing language, using which one can program using the objects that are been created. C++ have the provision of inheritence, constructors whereas you will not find these in C.
Still C is better then C++ because of its easy and understable syntax !!
C++ applications are generally slower at runtime, and are much slower to compile than C programs. The low-level infrastructure for C++ binary execution is also larger. For these reasons C is always commonly used even if C++ has alot of popularity, and will probably continue to be used in projects where size and speed are primary concerns, and portable code still required (assembly would be unsuitable then).

2006-10-19 03:37:16 · answer #3 · answered by Anonymous · 0 1

C is the superset of C++ as C++ is only a part of C.

C++ is more user friendly considering the fact of Programming grammar in both languages.
In C grammar to input we use the tedious scanf(...) and to print to console we use printf(...) but with C++, using 'cin' and 'cout' and overloading >> and << respectively.

Actually more C++ and C# progresses, C too progresses as a C++ or a C# copiler is actually a modified C compiler written originally in C.

Some DIFFERENCES which you actually want are not quite evident if you don't consider C to be old. Otherwise they are the same.

2006-10-19 19:18:20 · answer #4 · answered by Rahul Ghose 4 · 0 0

C is a subset of C++
it has all thoses features used in c but having enhanced facilities including OOP(object oriented programming). OOPs contains many features such as polymophism, inheritence etc. that r not the part of C programming it is just a procedure programming language, following top down technique.

2006-10-19 05:47:55 · answer #5 · answered by meet_anu_makkar 1 · 0 1

C++ has more capability, I have studied both.

Any time a programming language is modified and named then that becomes a different language. Other vise it is introduced as version X+1 or a revision X+1.

C and C++ are similar yet different languages.

2006-10-19 07:54:33 · answer #6 · answered by minootoo 7 · 0 1

C++ is a superset of C. C is an structural programming language while C++ supports object oriented programming.

2006-10-19 03:32:06 · answer #7 · answered by Hemantha A 1 · 1 1

Strousrup called C++ to be C with classes. But the current C++ standard has changed a lot from what it was. Loads of new stuff thrown in. BTW, is this a homework question? ;)

HTH

2006-10-19 03:51:40 · answer #8 · answered by ? 2 · 0 1

BIGGEST DIFFERENCE I WOULD SAY IS THE FACT THAT C++ ALLOWS YOU TO MAKE USE OF OBJECT ORIENTED PROGRAMMING WHILE C DOES NOT. C INSTEAD USES STRUCTURES TO MIMICK OO.

C IS A FUNCTIONAL PROGRAMMING LANGUAGE WHILE C++ IS A HYBRID LANGUAGE, MEANING, PROGRAMS IN C++ CAN BE FUNCTIONAL PROGRAMS OR OBJECT ORIENTED PROGRAMS.

2006-10-19 04:19:30 · answer #9 · answered by sinkablehail1978 5 · 1 1

C++ is object oriented C.

Rawlyn.

2006-10-19 03:58:18 · answer #10 · answered by Anonymous · 0 0

fedest.com, questions and answers