Results 1 to 5 of 5

Thread: Differnence between C and C++

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jul 2000
    Location
    California
    Posts
    154

    Talking Difference between C and C++

    Is there a major difference between C and C++?

  2. #2
    Guest
    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.

  3. #3
    Frenzied Member HarryW's Avatar
    Join Date
    Jan 2000
    Location
    Heiho no michi
    Posts
    1,827
    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."

  4. #4

  5. #5
    Frenzied Member HarryW's Avatar
    Join Date
    Jan 2000
    Location
    Heiho no michi
    Posts
    1,827
    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
  •  



Click Here to Expand Forum to Full Width