|
-
Jul 10th, 2000, 04:21 PM
#1
Thread Starter
Addicted Member
Difference between C and C++
Is there a major difference between C and C++?
-
Jul 10th, 2000, 04:33 PM
#2
C older and more DOS oriented. C++ is the improved version of C. It has more features such as classes, object orientation, memory allocation and IO.
There are a lot more, but I cannot think of them at the moment.
-
Jul 10th, 2000, 06:42 PM
#3
Frenzied Member
C++ was a new version of C written by Bjarne Stroustrup, in order to make C object oriented. That's the major difference - where C uses structs (that's types in VB), C++ uses classes.
As far as I know C had memory allocation too, in the form of the malloc() function, but I'm no expert on it (yet )
C++ is a bit easier in some ways, for instance instead of the printf() and scanf() functions you use cin and cout, which basically make it a lot simpler and legible.
Fundamentally they are the same - variables and operators are used in the same ways - but C uses types where C++ uses classes. If you are learning one you're more or less learning them both, except only C++ has classes and objects.
Harry.
"From one thing, know ten thousand things."
-
Jul 10th, 2000, 07:37 PM
#4
-
Jul 11th, 2000, 01:16 PM
#5
Frenzied Member
Oh and another thing - it's more strongly typed than C was. For instance you can't have variant pointers (pointers to void in C) in C++. It sounds like a limitation but it's a good thing because you can trap all your type errors at compile time ,instead of runtime.
Harry.
"From one thing, know ten thousand things."
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|