943,621 Members | Top Members by Rank

Ad:
  • C++ Discussion Thread
  • Unsolved
  • Views: 3923
  • C++ RSS
Jun 20th, 2008
0

Difference between C and C++

Expand Post »
Please tell me what is the basic differences between C and C++?
Similar Threads
Reputation Points: 38
Solved Threads: 0
Light Poster
allena is offline Offline
32 posts
since Jun 2008
Jun 20th, 2008
0

Re: Difference between C and C++

Moderator
Featured Poster
Reputation Points: 4142
Solved Threads: 394
Industrious Poster
Nick Evan is offline Offline
4,132 posts
since Oct 2006
Jun 20th, 2008
0

Re: Difference between C and C++

Basic difference is
C++ is Object Oriented with classes
and C is not.
Reputation Points: 34
Solved Threads: 3
Junior Poster in Training
ff4930 is offline Offline
58 posts
since Oct 2007
Jun 20th, 2008
0

Re: Difference between C and C++

Click to Expand / Collapse  Quote originally posted by ff4930 ...
Basic difference is
C++ is Object Oriented with classes
and C is not.
Not entirely though like java or c#
Reputation Points: 19
Solved Threads: 20
Posting Whiz in Training
joshmo is offline Offline
280 posts
since Oct 2007
Jun 20th, 2008
1

Re: Difference between C and C++

Team Colleague
Reputation Points: 5862
Solved Threads: 950
Posting Sage
Salem is offline Offline
7,164 posts
since Dec 2005
Jun 30th, 2008
-1

Re: Difference between C and C++

Please tell me about some functions that we can not use in C.
Reputation Points: 38
Solved Threads: 0
Light Poster
allena is offline Offline
32 posts
since Jun 2008
Jun 30th, 2008
0

Re: Difference between C and C++

Reputation Points: 12
Solved Threads: 7
Light Poster
RenjithVR is offline Offline
41 posts
since Mar 2008
Jun 30th, 2008
0

Re: Difference between C and C++

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.

Click to Expand / Collapse  Quote originally posted by allena ...
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.
Reputation Points: 55
Solved Threads: 10
Junior Poster in Training
n1337 is offline Offline
96 posts
since May 2008

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C++ Forum Timeline: read line from file
Next Thread in C++ Forum Timeline: error C2512: 'Dice' : no appropriate default constructor available





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC