Difference between C and C++ |
| |
|
|
|
New Poster Posts: 5 Topics: 1
|
|
|
September 23, 2008, 09:57:58 AM
|
we all work on both C and C++ but what is the main difference and can anyone tell me what is actually object oriented language!! 
« Last Edit: December 13, 2008, 05:44:05 AM by Admin »
|
|
| |
|
|
|
Code Guru Gender:  Posts: 1399 Topics: 85
|
|
|
September 23, 2008, 10:16:45 AM
|
|
Ok, well firstly OO is a programming paradigm. There are loads and loads of resources explaining this in more details, but basically its all about abstraction - the problem is broken up into distinct objects (which combine data and actions upon the data) and these interact. For an example consider a library - we could have a Book object, which has data title and author (strings), with actions being set the data, set the author, get the data, get the author etc... Then we could have another object called shelf which has data books and then have actions add book, remove book etc... This really is a very simple explanation, and theres lots more to it, if you are interested then consult some books. Theres also loads of debate about the advantages/disadvantages of OO and where it is most useful.
You are correct - C++ supports OO. When C++ was designed, the creator took C and added extensions to it - at that moment in time C++ could be thought of as C with some additions (the first C++ translators simply turned C++ code into C code for compilation!) - however, C continued to evolve (we current have the C99 ANSI standard) and because of this the languages diverged and there are now aspects of C which are not in C++ (because they came after this divergence.)
Both C and C++ are still very popular today and both continue to evolve.
« Last Edit: December 13, 2008, 05:44:30 AM by Admin »
|
|
| |
|
|
|
New Poster Posts: 10 Topics: 0
|
|
|
October 05, 2008, 06:47:50 PM
|
|
Simple one line understanding, C & C + + C is probably the most computer programming language used to write professional-level software, though new programs written today are usually done with its object-oriented successor, C + +. Both are best suited to well-trained programmers with the knowledge, tools, and time to avoid some major pitfalls.
« Last Edit: December 13, 2008, 05:44:43 AM by Admin »
|
|
| |
|
|
|
Code Guru Gender:  Posts: 1399 Topics: 85
|
|
|
October 06, 2008, 05:28:04 AM
|
C is probably the most computer programming language used to write professional-level software, though new programs written today are usually done with its object-oriented successor, C + +.
Unfortunately its really not that simple - Stroustrup himself describes C99 and C++ as siblings rather than C++ as a sucessor (which it is not.) For the major differences between C++98 and C99 I suggest you take a look at this website http://david.tribble.com/text/cdiffs.htmIt should be noted that there are plenty of (well known) programmers who perfer C over C++ for many of their tasks
« Last Edit: December 13, 2008, 05:44:56 AM by Admin »
|
|
| |
|
|
|
Regular Coder Gender:  Posts: 64 Topics: 20
|
|
|
November 19, 2008, 06:28:31 AM
|
|
1. c is not object oriented but c++ is object oriented concept. 2. C is procedural programming language 3. cin>> for input, cout<< as a output function 4. Scanf and printf are used. 5. In c we use #include<stdio.h>as inclusion file,while in c++ we use #include<iostream>as inclusion file.
« Last Edit: December 13, 2008, 05:45:09 AM by Admin »
|
|
| |
|
|
|
Code Guru Gender:  Posts: 1399 Topics: 85
|
|
|
November 19, 2008, 06:31:02 AM
|
|
6. C is an imperative language 7. In C we use malloc and free a huge amount - in C++ its the constructors and destructors more commonly.
« Last Edit: December 13, 2008, 05:45:21 AM by Admin »
|
|
| |
|
|
|
New Poster Posts: 5 Topics: 0
|
|
|
November 19, 2008, 09:20:08 AM
|
|
Well i would say it in a very simple sentence C++ is a better organized programming language than C could ever dream to be. I know i can say C++ has great features like Abstraction, Encapsulation, Inheritance etc. which may confuse you, but understand this any complex program you write in C is very hard to debug if an error comes even for the core programmers, but C++ is pretty much easy. HOPE MY ANSWER HELPED YOU
« Last Edit: December 13, 2008, 05:45:35 AM by Admin »
|
|
| |
|
|
|
Code Guru Gender:  Posts: 1399 Topics: 85
|
|
|
November 19, 2008, 09:46:46 AM
|
Well i would say it in a very simple sentence C++ is a better organized programming language than C could ever dream to be. I know i can say C++ has great features like Abstraction, Encapsulation, Inheritance etc. which may confuse you, but understand this any complex program you write in C is very hard to debug if an error comes even for the core programmers, but C++ is pretty much easy. HOPE MY ANSWER HELPED YOU
Really?
« Last Edit: December 13, 2008, 05:45:48 AM by Admin »
|
|
| |
|
|
|
Regular Coder Posts: 67 Topics: 33
|
|
|
January 01, 2009, 09:51:28 PM
|
|
there are lot of differences between c and c++. 1.in c language we use 'printf' for printing output and 'scanf' for getting the input 2.in c++ we use 'cout' and 'cin'. 3.the operators used in c are also used in c++, but c++ has some special operators such as scope resolution operators etc., 4.in c there is no concept of exception handling or inheritence.
|
|
| |
|
|
|
Code Guru Gender:  Posts: 1399 Topics: 85
|
|
|
January 02, 2009, 08:38:16 AM
|
1.in c language we use 'printf' for printing output and 'scanf' for getting the input
Not always - in C there are a number of different functions which will display and read input. An example is putc - the standard ones are defined in stdio.h 4.in c there is no concept of exception handling or inheritence.
Be careful here, statements like that are common - but not entirely true! There isn't the exception statement and block, but error handling is very possible in C and commonly implemented via longjumps, the C standard header file is setjmp.h for this. Inheritence? - well of course C does not have the OO concept but it is still possible to create "objects", manipulate them and provide all the services that inheritence honours - although all of this will look different to OO programming it still does the same thing.
« Last Edit: January 02, 2009, 09:50:07 AM by polas »
|
|
| |
|
|
|
New Coder
Location: UK
Gender: 
Age: 26
Posts: 20 Topics: 3
|
|
|
March 06, 2009, 05:22:46 AM
|
|
The main difference between C and C++ is that C++ is object oriented while C is function or procedure oriented. Object oriented programming paradigm is focused on writing programs that are more readable and maintainable. It also helps the reuse of code by packaging a group of similar objects or using the concept of component programming model. It helps thinking in a logical way by using the concept of real world concepts of objects, inheritance and polymorphism. It should be noted that there are also some drawbacks of such features. For example using polymorphism in a program can slow down the performance of that program.
To finish this discussion, 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).
|
|
| |
|
|
|
Code Guru Gender:  Posts: 1399 Topics: 85
|
|
|
March 09, 2009, 10:54:27 AM
|
To finish this discussion, C++ applications are generally slower at runtime, and are much slower to compile than C programs.
Are you sure? I have been plenty of results where C++ programs are actually faster runtime than C. Compile wise, I would be surprised if there was a huge difference for any complex application
|
|
| |
|
|
|
New Poster Posts: 3 Topics: 0
|
|
|
June 23, 2009, 04:37:51 AM
|
|
1)c is used to make small programs bt c++ is used to make large programs
2)c++ used the concepts of oop's i.e object oriented programing approach which include polimorphism, inheritence, object, classes.
c doesnt use the oops concept
3)in c++ main program call the subprogram throgh message passing bt in c calling concept is used.
|
|
| |
|
|
|
Code Guru Gender:  Posts: 1399 Topics: 85
|
|
|
June 29, 2009, 08:20:31 AM
|
1)c is used to make small programs bt c++ is used to make large programs
As of version 2.6.27, the Linux kernel is over 10 million lines of code. 96.4% is written in C (which by my calculations is 9.64 million lines), hardly what you would call a small program 
|
|
| |
|
|
|
New Poster Posts: 1 Topics: 0
|
|
|
August 23, 2009, 05:01:38 AM
|
|
C++ is a programming language which have some very helpful features to implement an object oriented design. Implementing an an object oriented design is C language is difficult, but not impossible.
|
|
| |
|
|
|
New Poster Posts: 3 Topics: 0
|
|
|
December 04, 2009, 03:15:02 AM
|
|
Hello... In C the objects i.e. variables mainly depend on functions, and the data which is stored in variables doesn't have any security, whereas in C++ every thing depends on objects, now the objects control the functions that is why it is called Object oriented programming.
« Last Edit: August 17, 2011, 09:21:17 PM by Admin »
|
|
| |
|
|
|
New Poster Posts: 10 Topics: 0
|
|
|
December 19, 2009, 10:24:35 AM
|
|
I beleive C++ is an expansion of the original C, as I know the lesser known C-- is a compact version.
|
|
| |
|
|
|
New Poster Posts: 1 Topics: 0
|
|
|
March 22, 2010, 05:38:52 AM
|
|
Actually c is a procedural programming language which cann't face the real world problem. It has some drawback like a global data is shared by all function and if in a large program it is find out difficult that which function uses which data.
On the other hand c++ is an object oriented programming language which eliminate some pitfall of conventional or procedural programming language. It is a concept or approach for designing a new software. It is nothing to do with any programming language although a programming language which support the oops concept to make it easier to implement.
This is the main different between c and c++.
|
|
| |
|
|
|
New Poster Posts: 1 Topics: 0
|
|
|
April 05, 2010, 01:51:03 AM
|
|
C++ is good and many extra feature compare to c like polymorphism and Inheritance . . .
|
|
| |
|
|
|
New Poster Posts: 1 Topics: 0
|
|
|
April 06, 2010, 02:38:06 AM
|
|
C is not object oriented language C++ is a object oriented language. First u have to know what is OOPS. Object oriented programming language is programming technique on objects. For clear description study about objects. C++ implements inhertiance, Operator overloading, Data encapsulation and others.
|
|
| |
|
|
|
New Poster Posts: 2 Topics: 0
|
|
|
April 19, 2010, 04:15:29 AM
|
|
nice to know
|
|
| |
|
|
|
New Coder Real name: josaph...
Location: Usa...
Posts: 17 Topics: 2
|
|
|
July 17, 2010, 12:15:08 AM
|
|
The C programming language is a very universal purpose programming language. It is used to solve problems ranging from operating system kernels, over compilers to graphical user interfaces. C++ was an effort to extend and change the C programming language to defeat some of the common and big problems with the language. C++, is a much younger language than C.
|
|
| |
|
|
|
New Poster Posts: 4 Topics: 0
|
|
|
July 30, 2010, 05:41:53 AM
|
|
The is number of difference in C and C++. First in C , It is a function oriented language and C++ is a object oriented programming language. In C++ user can create a class in C the user not need to create a class. C support the structure , enum data type where C++ can not support. C does not have the capability of the polymorphism, Inheritance where in C++ support the all the advantages.
|
|
| |
|
|
|
Code Guru Gender:  Posts: 1399 Topics: 85
|
|
|
August 01, 2010, 07:17:56 AM
|
I think we have done this one to death 
|
|
| |
|
|
|
Code Guru Gender:  Posts: 1399 Topics: 85
|
|
|
August 07, 2010, 03:41:08 PM
|
|
The only thing to be careful of compiling c with a c++ compiler, is that they diverged quite some time ago and minor details are slightly different. Probably not noticable for many codes but can catch you out.
|
|
| |
|
|
|
New Coder Posts: 15 Topics: 2
|
|
|
August 16, 2010, 03:47:31 AM
|
|
C++ was an improved version to C complete in the eighties to integrate OOP into C. C is a technical language while C++ is a non-procedural language. C was the C++ precursor. C++ tolerate the programmer to create classes, which are somewhat similar to C structures.
|
|
| |
|
|
|
New Poster Posts: 1 Topics: 0
|
|
|
September 06, 2010, 02:56:18 AM
|
|
C++ is a fully object oriented programming language (OOP) based on C. C++ is the advance level of C. So if you want to understand that difference, you should read on OOP. A good place to start is hxxp: en. wikipedia. org/wiki/Object-orie… I like OOP is mostly useful when working with very hard Program. Because i am Good worker in C++.
« Last Edit: September 06, 2010, 12:11:13 PM by polas »
|
|
| |
|
|
|
New Poster Posts: 1 Topics: 0
|
|
|
October 09, 2010, 02:49:38 AM
|
|
hello,
friend the c and c++ both are the language but main different is c is the processor language and c++ is the object oriented language. and nose right c++ is the advance verso of c.
thank
« Last Edit: August 28, 2011, 08:12:41 AM by Admin »
|
|
| |
|
|
|
New Poster Posts: 13 Topics: 1
|
|
|
October 31, 2010, 11:41:22 PM
|
|
c is not purely object oriented language but c++ is purely
|
|
| |
|
|
|
New Coder Posts: 28 Topics: 0
|
|
|
December 07, 2010, 06:34:18 PM
|
|
So difficult for me. i know little about the C++ even i had a training class about it in my college life.
|
|
| |
|
|
|
New Coder Posts: 28 Topics: 0
|
|
|
December 10, 2010, 05:51:29 PM
|
|
Right, C is not object oriented but c++ is object oriented concept. C++ supports OO.
|
|
| |
|
|
|
New Coder Posts: 28 Topics: 0
|
|
|
January 03, 2011, 05:41:58 PM
|
|
at that moment in time C++ could be thought of as C with some additions (the first C++ translators simply turned C++ code into C code for compilation!) - however, C continued to evolve (we current have the C99 ANSI standard) and because of this the languages diverged and there are now aspects of C which are not in C++ (because they came after this divergence.)
|
|
| |
|
|
|
New Coder Posts: 28 Topics: 0
|
|
|
January 03, 2011, 05:43:04 PM
|
|
It has been described as "an industry standard for graphics professionals"[1] and was one of the early "killer applications" on Macintosh.
|
|
| |
|
|
|
New Poster Posts: 11 Topics: 0
|
|
|
January 27, 2011, 11:44:48 PM
|
|
c is a procedural programming language which can't face the real world problem. On the other hand c++ is an object oriented programming language which eliminate some pitfall of conventional or procedural programming language. It is a concept or approach for designing a new software.
|
|
| |
|
|
|
New Coder Real name: Pooja Rani
Posts: 16 Topics: 0
|
|
|
February 01, 2011, 02:17:16 AM
|
|
Hi,thanks for sharing the information regarding to difference between C and C++. C is a procedural language while C++ is a object oriented language. Thanks a lot again for sharing the information here. . .
« Last Edit: June 27, 2011, 09:12:55 PM by Admin »
|
|
| |
|
|
|
New Coder Posts: 17 Topics: 1
|
|
|
February 07, 2011, 01:01:16 AM
|
|
OOP (object oriented programming) concept is the major difference between c and c++. C cant support inheritance.
|
|
| |
|
|
|
New Coder Posts: 21 Topics: 0
|
|
|
February 09, 2011, 01:35:43 AM
|
|
Below are some major difference between C and C++: 1. C follows the procedural programming paradigm while C++ is a multi-paradigm language 2. In case of C, the data is not secured while the data is secured(hidden) in C++ 3. We can use functions inside structures in C++ but not in C 4. C uses the top-down approach while C++ uses the bottom-up approach 5. C++ supports function overloading while C does not 6. C++ allows the use of reference variables while C does not Regards,
|
|
| |
|
|
|
New Poster Gender:  Posts: 8 Topics: 1
|
|
|
February 09, 2011, 03:05:17 AM
|
|
C++ is an extension of C++. The things which we cannot use in C like Class,etc C id Procedure Orient Programming and C++ is Object Oriented Programming Language
|
|
| |
|
|
|
New Poster
Location: USA
Gender: 
Age: 25
Posts: 5 Topics: 0
|
|
|
February 23, 2011, 04:03:20 AM
|
|
Hello guys. . . . ! Thanks for sharing information about C and C++. I think in C we use "printf" for output and in C++ we use "cout" for output. . . . !
|
|
| |
|
|
|
New Coder Posts: 15 Topics: 0
|
|
|
March 09, 2011, 12:45:08 PM
|
|
Difference between C and C++ as under :
- C is not object oriented but C++ is object oriented. - C use #include<stdio. h>as iclusion file and C++ use #include<iostreame>as inclusion file. - C is a topdown approach while C++ is bottom up approach. - C is the low level language while C++ is the high level language.
dell coupons codes
|
|
| |
|
|
|
New Coder Posts: 18 Topics: 0
|
|
|
March 10, 2011, 10:16:57 PM
|
|
Really nice comparision between the two, thank you for sharing!!. .
|
|
| |
|
|
|
Skilled Coder Posts: 125 Topics: 0
|
|
|
March 15, 2011, 02:05:31 AM
|
|
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 and class where as you will not find these in C.
|
|
| |
|
|
|
New Coder Posts: 18 Topics: 0
|
|
|
March 20, 2011, 11:28:14 PM
|
|
(The C programming language is a very universal purpose programming language. It is used to solve problems ranging from operating system kernels, over compilers to graphical user interfaces. C++ was an effort to extend and change the C programming language to defeat some of the common and big problems with the language. C++, is a much younger language than C. ) Perhaps the simplest answer!!. .
|
|
| |
|
|
|
New Poster Posts: 1 Topics: 0
|
|
|
March 21, 2011, 04:48:12 AM
|
|
C++ is the advance version of C. C++ implements the class which is a problem in C.
|
|
| |
|
|
|
New Coder Posts: 44 Topics: 0
|
|
|
March 23, 2011, 10:44:57 PM
|
|
The main difference is C++ is object oriented and C is not. This is right or wrong?
|
|
| |
|
|
|
Professional Coder Gender:  Posts: 242 Topics: 3
|
|
|
April 16, 2011, 06:29:17 AM
|
|
i think, the highlight of it all is that C++ supports Object Oriented Programming while C does not..
|
|
| |
|
|
|
New Poster Posts: 1 Topics: 0
|
|
|
April 19, 2011, 05:22:33 AM
|
|
C++ is the advanced version of C. C++ does not retain complete source-level compatibility with C. The main difference between C and C++ is that C++ is an object oriented where as C is just function or procedure oriented.
|
|
| |
|
|
|
New Coder Posts: 25 Topics: 1
|
|
|
April 20, 2011, 08:53:25 PM
|
|
C is basically a procedural language and it works in structured manner. C++ is object oriented language and close to real world. By object oriented means that objects will be created to access different variables and methods.,
|
|
| |
|
|
|
New Poster Posts: 3 Topics: 1
|
|
|
April 23, 2011, 03:03:01 AM
|
|
Basically C is the main programming language and C++ is the object oriented programming language.
|
|
| |
|
|
|
New Coder Real name: Michelle Jorgen
Posts: 42 Topics: 2
|
|
|
April 29, 2011, 12:03:53 AM
|
|
All says one thing but not mention the issue actual what is major diff between them
|
|
| |