c vs c++

This is a discussion on c vs c++ within the C++ Programming forums, part of the General Programming Boards category; i have heard that c's translation to asm is more effiecient than c++'s translation to asm. Can anyone prove/disprove this?...

  1. #1
    Registered User cppdude's Avatar
    Join Date
    Jan 2002
    Posts
    62

    c vs c++

    i have heard that c's translation to asm is more effiecient than c++'s translation to asm. Can anyone prove/disprove this?

  2. #2
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,789
    I guess there's no real answer to this as it would depend on the individual compiler.......a bit of a generalisation?

    Sounds like a stupid statement meant only to cause arguments on "which is best" (a topic of which this board already has hundeds of threads)

  3. #3
    Registered User
    Join Date
    Sep 2001
    Posts
    305
    well, C is a bit more lower level than C++ is. in C, you need to allocate memory manually, but in C++, you have the magical new and delete operators. classes getting translated to asm is not the easiest process either. polymorphism, inheritance, and other OOP things tend to become slower than C programs (and larger).

  4. #4
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,789
    Originally posted by Flikm
    [B]well, C is a bit more lower level than C++ is. in C, you need to allocate memory manually, but in C++, you have the magical new and delete operators.
    Er....the new and delete operators allocate memory as it is done in C (malloc.....) but there are a few extra things to new and delete (calling constructors, type safety....) and it is part of the actual language.....they still do the same job...No less lowlevel

    Originally posted by Flikm

    classes getting translated to asm is not the easiest process either. polymorphism, inheritance, and other OOP things tend to become slower than C programs (and larger).
    Again I would say this depends on the compiler.......

  5. #5
    Registered User cppdude's Avatar
    Join Date
    Jan 2002
    Posts
    62
    hmm i posted this topic somewhere else to get people's replies, and someone posted me this. Its apparently an interview with the creator of c++. What do you guys think? http://www.program.com/humor/bjarne.html

    i didnt believe it myself but i am not sure.

  6. #6
    S­énior Member
    Join Date
    Jan 2002
    Posts
    982
    Wow, I'm off to learn D (or maybe VB).

  7. #7
    Registered User cppdude's Avatar
    Join Date
    Jan 2002
    Posts
    62
    take note it has the word "humor" in the url. But i am not entirely sure if its bogus or not. Anyone like to prove/disprove?

  8. #8
    S­énior Member
    Join Date
    Jan 2002
    Posts
    982
    Unfortunately it's a hoax. I wonder if my local bookstore will take back all this VB stuff I've just gone an bought?

  9. #9
    Registered User cppdude's Avatar
    Join Date
    Jan 2002
    Posts
    62
    your joking right? yes i know im gullible

  10. #10
    S­énior Member
    Join Date
    Jan 2002
    Posts
    982
    Sorry.

Popular pages Recent additions subscribe to a feed

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21