Difference between C and C++

Please support our C++ advertiser: Intel Parallel Studio Home
Reply

Join Date: Jun 2008
Posts: 32
Reputation: allena is an unknown quantity at this point 
Solved Threads: 0
allena allena is offline Offline
Light Poster

Difference between C and C++

 
0
  #1
Jun 20th, 2008
Please tell me what is the basic differences between C and C++?
Reply With Quote Quick reply to this message  
Join Date: Oct 2006
Posts: 2,915
Reputation: niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute 
Solved Threads: 304
Moderator
Featured Poster
niek_e's Avatar
niek_e niek_e is offline Offline
Cenosillicaphobiac

Re: Difference between C and C++

 
0
  #2
Jun 20th, 2008
Reply With Quote Quick reply to this message  
Join Date: Oct 2007
Posts: 58
Reputation: ff4930 is an unknown quantity at this point 
Solved Threads: 2
ff4930 ff4930 is offline Offline
Junior Poster in Training

Re: Difference between C and C++

 
0
  #3
Jun 20th, 2008
Basic difference is
C++ is Object Oriented with classes
and C is not.
Reply With Quote Quick reply to this message  
Join Date: Oct 2007
Posts: 280
Reputation: joshmo is an unknown quantity at this point 
Solved Threads: 19
joshmo joshmo is offline Offline
Posting Whiz in Training

Re: Difference between C and C++

 
0
  #4
Jun 20th, 2008
Originally Posted by ff4930 View Post
Basic difference is
C++ is Object Oriented with classes
and C is not.
Not entirely though like java or c#
Reply With Quote Quick reply to this message  
Join Date: Dec 2005
Posts: 5,850
Reputation: Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute 
Solved Threads: 749
Team Colleague
Salem's Avatar
Salem Salem is offline Offline
Void main'ers are DOOMed

Re: Difference between C and C++

 
1
  #5
Jun 20th, 2008
Reply With Quote Quick reply to this message  
Join Date: Jun 2008
Posts: 32
Reputation: allena is an unknown quantity at this point 
Solved Threads: 0
allena allena is offline Offline
Light Poster

Re: Difference between C and C++

 
-1
  #6
Jun 30th, 2008
Originally Posted by Salem View Post
More differences.
http://david.tribble.com/text/cdiffs.htm
Please tell me about some functions that we can not use in C.
Reply With Quote Quick reply to this message  
Join Date: Mar 2008
Posts: 41
Reputation: RenjithVR is an unknown quantity at this point 
Solved Threads: 7
RenjithVR RenjithVR is offline Offline
Light Poster

Re: Difference between C and C++

 
0
  #7
Jun 30th, 2008
Reply With Quote Quick reply to this message  
Join Date: May 2008
Posts: 87
Reputation: n1337 is on a distinguished road 
Solved Threads: 8
n1337 n1337 is offline Offline
Junior Poster in Training

Re: Difference between C and C++

 
0
  #8
Jun 30th, 2008
Well...those links have a lot of the differences. I think basically C++ is an extension of C with added features. You can still use C code in C++, and code in a "C-Style", but C++ has features that do away with some C stuff.

In terms of abstraction from the machine, C is very low level. It was designed to be basically a thin layer over the machine, providing the functionality and sort of direct interfacing of machine-level or assembly-code, but being portable (assembly and machine code is not portable, i.e. it is dependent on the architecture). You should read about the history of C...here is one place to start.

So then, C++ is an extension to the C language. It has added functionality. In particular, it has a rather extensive standard library (compared to C), or rather has an extended library. It also supports the idea of objects and classes, and supports large-scale projects and security better than does C. You should read about the history of C++ as well and read the links provided above to get some of the more technical differences.

Originally Posted by allena View Post
Please tell me about some functions that we can not use in C.
Uhhhh well I really was only learning C in school, and am just sort of learning C++ because. Everywhere I look (and from what my profs tell me) you should learn C first, and then learn C++ (easy transition). In terms of actual functions, well:

One thing I noticed right away when I switched was that C++ programmers love to use strings (i.e. the string class) whereas we (the C users) had to constantly be using pointers to characters...aha. Vectors also seem to be used a lot, rather than dynamically allocated arrays or perhaps more suitable custom-designed structs...Another thing (more annoyance really) is that there is no boolean type in C -- just meant you had to #define TRUE and FALSE if you wanted to use them instead of integers. Uhh I also tend to not use the standard library so much, partly because my prof forbade us from using it and made us implement everything ourselves, and also because the C library is not as large..but C++ users (at least the ones here) tend to use STL extensively. Classes are really just structs in disguise (ahaha), but they have some other cool features (that I am still investigating). Ummm there are a lot of other differences, but they are also similar in so many ways. My advice: learn C, and you will know C++ (or the transition will not be difficult). Don't start with C++, because you will probably not want to go back and learn C.
Optimist: This glass is half full!
Pessimist: This glass is half empty!
Engineering Consultant: This glass is twice as big as it needs to be...
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC