Here's the question you clicked on:

55 members online
  • 0 replying
  • 0 viewing

agdgdgdgwngo

  • 4 years ago

What can C do, that C++ cannot do (or can do but with far greater difficulty)?

  • This Question is Closed
  1. rooneyful
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    lol..Well..to be frank agdgdgdgwngo, I thought it was the other way round..I thought C++ was more efficient and advanced when compared to C. Maybe its just my ignorance, but yeah, I sure would like to know this too. I always liked C++ when compared to C. Who would like scanf printf stuff when compared to some neat cin cout :D

  2. opiesche
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 2

    The answer is: nothing. C++ compilers can also compile C - as such, C is a subset of C++, and anything that can be done in C can hence be done in C++ :P

  3. llib_xoc
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    C is perceived to be more efficient. C++ is much less used in embedded systems where performance is very important. I don't know whether C++ has been measured to be slower, or whether developers are simply staying with a language that they know how to write fast code in. Example, the VxWorks real time operating system was entirely written in C the last time that I looked.

  4. agdgdgdgwngo
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    C isn't exactly a subset of C++: http://stackoverflow.com/questions/1201593/c-subset-of-c-where-not-examples but beyond those features, and the fact that C compilers can be much simpler than C++ compilers, and that "C is faster" (which depends a lot on the compiler), I would say that C++ is far richer than C :(

  5. rsmith6559
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    C++ is a superset of C. Stoussup described as a "better" C. C++ would be slightly slower than C, there are runtime data structures that C++ keeps that C doesn't.

  6. llib_xoc
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    If you're thinking about runtime type ID and exception=handling structures, yes. I can't think of any others. And a good compiler or informed programmer can avoid them. Did you, have other structures in mind?

  7. rsmith6559
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    Those were the ones that I was thinking of. The difference wouldn't be too significant, but I think systems programming will probably lean towards C and applications toward C++.

  8. Not the answer you are looking for?
    Search for more explanations.

    • Attachments:

Ask your own question

Sign Up
Find more explanations on OpenStudy
Privacy Policy