Thread: The Ultimate Newbie Question...

  1. #1
    Registered User
    Join Date
    Jun 2002
    Posts
    31

    The Ultimate Newbie Question...

    What is the difference between C and C++?

    I started taking a class in C, and am also learning C++ on my own...

    Am I wasting my time? Are there significant differences between the two? I have heard that C++ is an extension of C - but you do not have to learn C to learn C++

    Thanks.
    Welcome to the funhouse, where strange mirrors reflect the faces of insanity.

  2. #2
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,897
    >What is the difference between C and C++?
    [diplomatic answer]
    They are two different langauges that solve problems in different ways.
    [/diplomatic answer]

    >Am I wasting my time?
    Definitely not. If you know both C and C++ then you'll be better off than if you only knew one of them.

    >I have heard that C++ is an extension of C - but you do not
    >have to learn C to learn C++
    Originally C++ was a superset of C, but over time both languages evolved independently of each other. The syntax can be similar, so if you know C then you are well on your way to knowing C++. But because of differences in the languages, perfectly valid and correct C can be broken as C++, this is why it is not usually recommended that you learn C first. I personally feel that the order in which you learn them doesn't matter as much as learning them both in the end.

    -Prelude
    My best code is written with the delete key.

  3. #3

  4. #4
    Registered User
    Join Date
    Jun 2002
    Posts
    31
    Yes, thank you. That gave me more insight than I had.

    I've been programming in Visual Basic for a few years and I never knew just how much I took it for granted. Something as simple as opening a Random Access file, reading the 100th, 200th and 350th record - which I could write in VB in just under a minute (I type about 75 words / minute) - I find is taking me almost an entire day to figure out in C++.

    Could be because I'm starting out in the wrong place... Rather than take the time to learn what the different datatypes are and how to us 'em, I just jumped right in and keep my fingers crossed that the compiler will tell me what's wrong.... probably not the best approach?
    Welcome to the funhouse, where strange mirrors reflect the faces of insanity.

  5. #5
    Registered User
    Join Date
    Jan 2002
    Posts
    559
    Bjarne Stroustrop, the main founder of C++, has an article about the differences and compatability of C/C++ here.
    Truth is a malleable commodity - Dick Cheney

  6. #6
    Registered User
    Join Date
    Jun 2002
    Posts
    44

    Exclamation

    NEVER SWITCH FROM C/C++ IT'S THE BEST LANGUAGE(FASTEST,MOST ETHICAL),INSTEAD STICK THROUGH IT AND LEARN,YOu WILL BE GLAD YOU DID.

  7. #7
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,897
    >I just jumped right in and keep my fingers crossed that the
    >compiler will tell me what's wrong.... probably not the best approach?
    Not exactly, even though I know people who make a very good living doing just that. Not on my project team though.

    >NEVER SWITCH FROM C/C++<...snip nonsense>
    While C and C++ are two popular and powerful langauges, only a fool would restrict themselves to just those two. The more languages you know, the more marketable you are. Also, some languages are custom tailored to specific jobs and by using them you increase productivity a great deal. This is far more important than shaving off clock ticks with a language that can create faster code in triple the production time.

    -Prelude
    My best code is written with the delete key.

  8. #8
    Just a Member ammar's Avatar
    Join Date
    Jun 2002
    Posts
    953
    I don't think it's VERY important to learn C, because C++ has many BETTER things, like CLASSES I can't think of programming without classes(OOP)...
    Maybe because I'm new to programming.

    Ammar...

  9. #9
    Registered User
    Join Date
    Jun 2002
    Posts
    44
    Prelude:
    I meant never drop C/C++from your reportoire,and if you don't think clock-ticks are important then you are cheating your customers as so many organizations do.

  10. #10
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,897
    >I meant never drop C/C++from your reportoire
    That's wildly different from "never switch from C/C++".

    >if you don't think clock-ticks are important then you are cheating your customers
    Hardly, I understand that efficiency is important to a point. If you don't ever get your projects onto the market then it doesn't matter how fast the code is. Also, the choice of language isn't nearly as important as the choice of algorithm, so it's best to choose the langauge that is best suited to the task at hand.

    But to make a long story short, I cheat my customers anyway. I work at a bank.

    -Prelude
    My best code is written with the delete key.

  11. #11
    Registered User Dual-Catfish's Avatar
    Join Date
    Sep 2001
    Posts
    802
    Perhaps you could have checked the FAQ board... yawn.

  12. #12
    Registered User
    Join Date
    Jun 2002
    Posts
    31
    I didn't even know there was a FAQ board. I bookmarked right to the C++ board.

    Sorry.
    Welcome to the funhouse, where strange mirrors reflect the faces of insanity.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Stupid Newbie question
    By TimL in forum C++ Programming
    Replies: 4
    Last Post: 07-22-2008, 04:43 AM
  2. Newbie with Very Newbie Question
    By Jedi_Mediator in forum C++ Programming
    Replies: 18
    Last Post: 07-01-2008, 08:00 AM
  3. C prog newbie question
    By Draginzuzu in forum C Programming
    Replies: 1
    Last Post: 02-03-2003, 06:45 PM
  4. a stupid question from a newbie
    By newcomer in forum C++ Programming
    Replies: 4
    Last Post: 01-11-2003, 04:38 PM
  5. newbie class templates question
    By daysleeper in forum C++ Programming
    Replies: 2
    Last Post: 09-18-2001, 09:50 AM