[ Home  |  FAQ-Related Q&As  |  General Q&As  |  Answered Questions ]


    Search the Q&A Archives


List all the differences between c and c++ languages

<< Back to: C++ FAQ (part 1 of 10)

Question by parimala
Submitted on 1/23/2004
Related FAQ: C++ FAQ (part 1 of 10)
Rating: Rate this question: Vote
List all the differences between c and c++ languages



Answer by Cheentu
Submitted on 4/8/2004
Rating:  Rate this answer: Vote
For getting list of differences between c and c++ u must follow books.

For c++ u can use book of Robert Lafore

 

Answer by mk
Submitted on 8/6/2004
Rating: Not yet rated Rate this answer: Vote
The main difference between C and C++ is that C isn't object-oriented. Okay---that doesn't actually tell you what you want to know; here are some details:


structs don't copy in C. That is, if a and b are structs then the line a = b; doesn't work. Nor will structs be fed into functions as arguments. The only way to deal with them sensibly is to use pointers to them, or to write functions to copy their elements explicitly. classes (with private members) don't exist in C.

There is no operator and function overloading in C. If a function has a name, then that's it---you can't have another version with the same name that does the same thing with different arguments, as you can in C++. The fact that << and >> (left and right shift) do output and input in C++ is a consequence of the ability of the language to overload those operators. Output and input in C are handled by functions called printf and scanf respectively (these also work in C++ if you want, of course).

In C storage allocation and de-allocation are not handled by new and delete but by a function called malloc. In general, the whole process is a bit more messy in C, but is not too bad once you get the hang of it.

 

Answer by dckreddy
Submitted on 9/18/2004
Rating: Not yet rated Rate this answer: Vote
what do I love?

 

Answer by krishna kant lowanshi
Submitted on 7/28/2005
Rating: Not yet rated Rate this answer: Vote
I think that c in enough for programming .Because it code is easy to write and check no problem if some thing is large than comfertable .

 

Answer by hari
Submitted on 8/30/2005
Rating: Not yet rated Rate this answer: Vote
volatile variable

 

Answer by split
Submitted on 9/1/2005
Rating: Not yet rated Rate this answer: Vote
i want a crisp answers

 

Answer by jajnyadutta panda
Submitted on 10/8/2005
Rating: Not yet rated Rate this answer: Vote
c++ is better than  c by using  because c++ have more library available for it,. it support oops , data abraction.

 

Answer by nagarjuna
Submitted on 10/26/2005
Rating: Not yet rated Rate this answer: Vote
list all  the  major  differnces between c & c++

 

Answer by Dharmarajan V. (Programmer)
Submitted on 2/18/2006
Rating: Not yet rated Rate this answer: Vote
C was the C++ predecessor. As it's name implies, alot of C remains in C++. Although not actually being more powerful than C, C++ allows the programmer to more easily manage and operate with Objects, using an OOP (Object Oriented Programming) concept.

C++ allows the programmer to create classes, which are somewhat similar to C structures. However, to a class can be assigned methods, functions associated to it, of various prototypes, which can access and operate within the class, somewhat like C functions often operate on a supplied handler pointer.

Although it is possible to implement anything  which C++ could implement in C, C++ aids to standarize a way in which objects are created and managed, whereas the C programmer who implements the same system has alot of liberty on how to actually implement the internals, and style among programmers will vary alot on the design choices made.

In C, some will prefer the handler-type, where a main function initializes a handler, and that handler can be supplied to other functions of the library as an object to operate on/through. Others will even want to have that handler link all the related function pointers within it which then must be called using a convention closer to C++.

Re Matthew: Well, yes and no. Actually C++ is a separate language in its own right that shares a lot with C.

Type checking for example is much more rigid in C++ than it is in C, so many a program that compiles just fine under a C compiler will result in many warnings and errors under a C++ compiler.

So, while C++ might be seen as "C with classes" by some, it actually is different and targeted at a different audience. C still is the best choice for code that has to be fast while still being reasonably readable and portable, eg. device drivers. C++ on the other hand is mainly used in large projects of millions of lines of code, where C code would become unmaintainable. This is mainly due to the possibility to reuse existing code by exploiting the OOP concepts of polymorphism and inheritance.

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).

 

Answer by parul sawhney
Submitted on 5/28/2006
Rating: Not yet rated Rate this answer: Vote
the major difference is that C is structured programming language where as C++ is object oriented language
another important difference between speed
C is faster than C++
type checking is more complex in C++
code reusablity is the major advantage in C++
C is a subset of C++
all the functions of C will work in C++ but the reverse is not true

 

Answer by Ankit
Submitted on 8/1/2006
Rating: Not yet rated Rate this answer: Vote
in c we can't take same name function but we take in c++ we can take same name function and procedure.

 

Answer by prakash
Submitted on 8/10/2006
Rating: Not yet rated Rate this answer: Vote
differences between c and c++ languages

 

Answer by cristiano
Submitted on 8/24/2006
Rating: Not yet rated Rate this answer: Vote
manuntd

 

Answer by amarendra
Submitted on 10/28/2006
Rating: Not yet rated Rate this answer: Vote
deferent between c and c++

 

Answer by saravanan
Submitted on 12/9/2006
Rating: Not yet rated Rate this answer: Vote
my preferable choice is C .coz C has extendable function and libraries although c++ is simply good but C is better than comparing with c++.Even a little prblm has been solved by C is ridiculous.C supports system side projects but c++ slightly depends on user manual.

 

Answer by pomerian
Submitted on 12/27/2006
Rating: Not yet rated Rate this answer: Vote
The basic difference between c&c++ is oops c++ is advance version of c, c++ has the concept called oops (Object Oriented Procedural Language).

 

Answer by mabbu
Submitted on 3/5/2007
Rating: Not yet rated Rate this answer: Vote
The main difference between c and c++ was oops concept that c++ have and c doesn't have.And another thing is Syntax that created by c will be easier when compared to c++.The c will be more comfortable than c++.

 

Answer by koti
Submitted on 3/20/2007
Rating: Not yet rated Rate this answer: Vote






























































 

Answer by Neelamadhab Mallick
Submitted on 3/26/2007
Rating: Not yet rated Rate this answer: Vote
Main difference between C & C++ is
1. C is loosely typed language where as C++ is tightly typed language.
2.C doesn't have the exception handling where as C++ has.
3.It is modular programming & C++ is objected oriented programming(But Not Fully OOPS)
4.Data are freely move in the programming in C but not in C++ due to data Hiding
5.C doesn't obey the real world object where C++ obeys through data hiding,abstraction,polymorphisim,overloading,data binding etc.
6.C++ has the class and structure where as C contain only structure

 

Answer by fifo
Submitted on 5/19/2007
Rating: Not yet rated Rate this answer: Vote
how u can look then you can see by that way

 

Answer by uday
Submitted on 7/17/2007
Rating: Not yet rated Rate this answer: Vote
c is a object based language
while
c++ is object oriented language

uday..

 

Your answer will be published for anyone to see and rate.  Your answer will not be displayed immediately.  If you'd like to get expert points and benefit from positive ratings, please create a new account or login into an existing account below.


Your name or nickname:
If you'd like to create a new account or access your existing account, put in your password here:
Your answer:

FAQS.ORG reserves the right to edit your answer as to improve its clarity.  By submitting your answer you authorize FAQS.ORG to publish your answer on the WWW without any restrictions. You agree to hold harmless and indemnify FAQS.ORG against any claims, costs, or damages resulting from publishing your answer.

 

FAQS.ORG makes no guarantees as to the accuracy of the posts. Each post is the personal opinion of the poster. These posts are not intended to substitute for medical, tax, legal, investment, accounting, or other professional advice. FAQS.ORG does not endorse any opinion or any product or service mentioned mentioned in these posts.

 

<< Back to: C++ FAQ (part 1 of 10)


[ Home  |  FAQ-Related Q&As  |  General Q&As  |  Answered Questions ]

© 2008 FAQS.ORG. All rights reserved.