LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices



Reply
 
Search this Thread
Old 05-26-2002, 05:10 AM   #1
Chooco
Member
 
Registered: May 2002
Location: Mexico
Distribution: Slackware
Posts: 118

Rep: Reputation: 15
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"
 
Old 05-26-2002, 03:27 PM   #2
Config
Member
 
Registered: Jan 2001
Location: Switzerland
Distribution: Gentoo
Posts: 376

Rep: Reputation: 30
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.
 
Old 05-26-2002, 09:09 PM   #3
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,539

Rep: Reputation: 149Reputation: 149
Classes, virtual functions, polymorphism in general, templates...
 
Old 05-27-2002, 11:57 AM   #4
slink
LQ Newbie
 
Registered: May 2002
Distribution: Redhat, Suse, Slackware
Posts: 9

Rep: Reputation: 0
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.
 
Old 06-02-2002, 04:37 AM   #5
MobyTurbo
Member
 
Registered: May 2002
Location: Brooklyn, NY
Distribution: Slackware
Posts: 45

Rep: Reputation: 15
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.
 
Old 06-06-2002, 11:15 AM   #6
kahuna
Member
 
Registered: Jun 2002
Location: Grand Rapids, MI
Distribution: Redhat, Slackware
Posts: 78

Rep: Reputation: 15
The real difference is in the amount of hair that you rip out of your head and the amount of beer consumed while coding!
 
Old 06-06-2002, 05:19 PM   #7
vfs
Member
 
Registered: Apr 2002
Location: Brazil
Distribution: Slackware
Posts: 184

Rep: Reputation: 30
Code:
main()
{
    int C = 1;

    while (0) {
           C++;
     }
}

}
 
Old 06-06-2002, 08:26 PM   #8
kahuna
Member
 
Registered: Jun 2002
Location: Grand Rapids, MI
Distribution: Redhat, Slackware
Posts: 78

Rep: Reputation: 15
VFS!!!

Quote:
Originally posted by vfs
Code:
main()
{
    int C = 1;

    while (0) {
           C++;
     }
}

}
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!!!
 
Old 06-07-2002, 01:23 AM   #9
Chooco
Member
 
Registered: May 2002
Location: Mexico
Distribution: Slackware
Posts: 118

Original Poster
Rep: Reputation: 15
AHAHAHAHAHAHAHAH!!!!

he should go to windows, they need of that good ol incorrect programming skills
 
Old 06-07-2002, 08:14 AM   #10
vfs
Member
 
Registered: Apr 2002
Location: Brazil
Distribution: Slackware
Posts: 184

Rep: Reputation: 30
Well, I just tried to mess with the compiler!!!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
what are the differences? LinuxPadawan Linux - General 10 07-27-2005 04:39 PM
Differences between 9.1 and 10 mikeymorgan Slackware 4 03-28-2005 05:42 AM
some differences linuxanswer Programming 1 04-09-2004 11:13 PM
cp -a or cp -R differences shanenin Linux - Software 4 02-01-2004 11:44 PM
R and TM differences? mikeshn General 1 09-10-2002 09:01 PM


All times are GMT -5. The time now is 06:49 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration