Note: I refer to C89 (the 1989 spec for C) here. C99 does have some enhancements and the below may be a little inaccurate there. C89 is more widely adopted however)
Some differences off the top of my head:
* C++ supports objects - C does not
* C++ has stronger type support than C:
E.g.
int foo(); declaration defaults to int foo(int) in C.
It means int foo(void); in C++.
* C++ supports bool. C does not
* C++ supports inline which does away with the need for macros like:
#define MAX(A,B) ...
This can become a regular function with C++ and would also have type checking.
* C++ supports template system that lets you define a function without specifying a data type. So you can write a generic single implementation of max and the C++ compiler can create max(int,int) max(float, float) etc. at compile time. In C, you would need to implement max_i(int, int), max_f(float, float) etc. separately
* C++ supports function overloading (multiple functions with same name - differentiated based on paramters) C does not.
* C++ supports references which help you minimize the use of pointers. C does not. For example, you would typically write:
void give_max(int a, int b, int *retval) in C
but in C you can write
void give_max(int a, int b, int & retval).
You would pass retval as &x in C but simply as x in C++.
Hope this helps.
2006-07-19 04:18:45
·
answer #1
·
answered by zero 2
·
1⤊
0⤋
C runs faster. C++ has libraries with code that starts out #include. Metaphorically, to make your bed using C you have to build the bed first. C has a language feature called structs that get you going with a code template.
Both languages offer multiple inheritance. Java uses similar syntax as C++ and they tried to include all the templates already prebuilt like those I mentioned for C's struct. Java is single inheritance and runs a bit slower. Java has to have an engine to run. C/C++ run by themselves and some of the complies you do with the Cs have to be tweaked for different computer processors.
2006-07-18 23:52:12
·
answer #2
·
answered by Anonymous
·
0⤊
0⤋
C++ is object oriented. If the quantity requires oop, go with c++. C is standard procedural. it does not support oop and newer language possibilities. For instance, C is opposed to objects and data and methods. C++ however is a multi paradigm language. They allow a program to use more than one programming style. You are possibly able to write a procedural language using C++. OOP and Generic programming are supported by C++.
2006-07-19 00:24:46
·
answer #3
·
answered by Anonymous
·
0⤊
0⤋
a million. huge :-) C is fairly low-aspect programming language; C++ is merchandise-orientated programming language extending undeniable C. C# is should you prefer to create purposes with out very nearly any programming expertise. 2. genuinely, certain. 3. close to a month from C to C++ and close to a 0.5 an hour from C++ to C#. 4. it is the perfect (if no longer the in basic terms one) way.
2016-11-06 19:57:40
·
answer #4
·
answered by ? 4
·
0⤊
0⤋
c++ is more object oriented language than c
c++ separates better the implementation from the interface
c allow you to program in a low level
2006-07-18 23:44:11
·
answer #5
·
answered by Javy 2
·
0⤊
0⤋
In a nutshell (an overly simplified nutshell), C++ is object C.
Rawlyn.
2006-07-18 23:40:07
·
answer #6
·
answered by Anonymous
·
0⤊
0⤋
C++ is object oriented language while C is not.
2006-07-18 23:42:19
·
answer #7
·
answered by Anonymous
·
0⤊
0⤋
C++ is higher than a normal C.
2006-07-18 23:41:07
·
answer #8
·
answered by c.ronaldo 3
·
0⤊
0⤋
ashish k you welcome. You will find your answer with this link
http://www.google.co.uk/search?hl=en&q=differences+BETWEEN+C+and+C%2B%2B&btnG=Search&meta=
2006-07-18 23:43:03
·
answer #9
·
answered by Joe_Young 6
·
0⤊
0⤋