c++ and c question
Results 1 to 6 of 6

Thread: c++ and c question

  1. #1
    Senior Member
    Join Date
    Nov 2001
    Posts
    257

    c++ and c question

    I'm taking some programming classes again, and the school requires an introduction to the C programming language class. My many credits of C++ classes dont seem to proclude me from it, but I don't want to bore the hell out of myself in an introductory class. So, I'm going to take the final to avoid the course, only I've never used C, only C++.

    My question would be, then, at an introductory level, what are the differences that one should know about? I figure they're mostly syntax, scan/print instead of cin/cout or stdio instead of iostream, but I'm really not sure.
    -Shkuey
    Living life one line of error free code at a time.

  2. #2
    Senior Member
    Join Date
    Sep 2001
    Posts
    1,027
    for an introductory class, you probably should brush up on string manipulations (char arrays), structs, pointers...

    Ammo
    Credit travels up, blame travels down -- The Boss

  3. #3
    Jaded Network Admin nebulus200's Avatar
    Join Date
    Jun 2002
    Posts
    1,356
    On your basic level, the only thing that I remember off of the top of my head, is the following:

    Your IO is different from C to C++ (as you said with printf/scanf).
    Your objects in C++ are structs in C and are much more limited as to what you can do with them.

    After that, the more advanced features start to get a little more confusing. If memory serves there is no operator overloading in C but there are things that you can do that are similar with functions. I don't think there are any templates or anything like them in C. I am also wanting to say that C doesn't readily support traps/exception throwing like C++.

    Anyway, the biggest thing is that C is not nearly as object oriented as C++ and so the philosophy you would take in design is a little different than you may be used to, but most of the things you will run into will probably be related to differences in syntax and includes. At the very least it will probably make you appreciate C++ a little more

    Neb
    There is only one constant, one universal, it is the only real truth: causality. Action. Reaction. Cause and effect...There is no escape from it, we are forever slaves to it. Our only hope, our only peace is to understand it, to understand the 'why'. 'Why' is what separates us from them, you from me. 'Why' is the only real social power, without it you are powerless.

    (Merovingian - Matrix Reloaded)

  4. #4
    Senior Member
    Join Date
    Jul 2001
    Posts
    420
    I found C very enjoyable and extrmely useful. I frequently write C programs. Depending on the structure of the course an intro C might not be that bad. Obvious differences C uses stdio.h and does not have classes -but everything you do in a class can be done in a struct (except inhertiance). I also discovered that my upper level course all required C to complete assignments and not C++ (I graduated 4 years ago this might have changed).

    Post above very similiar -beat me to it by a few moments -butr I'm still going to leave it.
    If you spend more on coffee than on IT security, you will be hacked. What\'s more, you deserve to be hacked.
    -- former White House cybersecurity adviser Richard Clarke

  5. #5
    Senior Member
    Join Date
    Nov 2001
    Posts
    257
    Thanks everyone.
    -Shkuey
    Living life one line of error free code at a time.

  6. #6
    er0k
    Guest
    i wish i could take a C/C++ class Lucky bastard :P

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •