LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   what are some differences between C and C++? (https://www.linuxquestions.org/questions/programming-9/what-are-some-differences-between-c-and-c-21832/)

Chooco 05-26-2002 04:10 AM

what are some differences between C and C++?
 
they are similar are they not? i asked this before at a forum for a game add on (what a place) and the writer of the game add on said they are very similar but there's just a few differences between them. what are those differences?

sorry if it's a dumb question but i'm only at page 100 of my Learn C++ in 21 Days book then i hear some guy say "C is the mother of all languages, you should learn it first"

Config 05-26-2002 02:27 PM

Well, c++ gives you a little more features (classes and function overloading mainly) but it is a slower than just plain c.
Since C++ is just an improved C, you can use plain C and compile it using a C++ compiler.

Mara 05-26-2002 08:09 PM

Classes, virtual functions, polymorphism in general, templates...

slink 05-27-2002 10:57 AM

In C++ you have more modularity -- I think that would be the way to put it. You get some things that you cant get in C, like Classes and function overloading.

MobyTurbo 06-02-2002 03:37 AM

The basic thing C++ adds to C are object oriented programming constructs. These are things like classes, methods, inheritance, and overloading. These can be very useful for GUI programs, but are also often a source of bloat.

kahuna 06-06-2002 10:15 AM

The real difference is in the amount of hair that you rip out of your head and the amount of beer consumed while coding! :)

vfs 06-06-2002 04:19 PM

Code:

main()
{
    int C = 1;

    while (0) {
          C++;
    }
}

}

:D

kahuna 06-06-2002 07:26 PM

VFS!!!
 
Quote:

Originally posted by vfs
Code:

main()
{
    int C = 1;

    while (0) {
          C++;
    }
}

}

:D

shouldn't that be int main()? Your while loop never gets executed since 0 is false. You forgot to return 0 at the end also!!!

What an atrocity!!! :)

Chooco 06-07-2002 12:23 AM

AHAHAHAHAHAHAHAH!!!!

he should go to windows, they need of that good ol incorrect programming skills ;)

vfs 06-07-2002 07:14 AM

Well, I just tried to mess with the compiler!!! :D


All times are GMT -5. The time now is 10:55 PM.