Thread: How C do I need to know to start C++

  1. #1
    Registered User Bassglider's Avatar
    Join Date
    Nov 2007
    Posts
    32

    How C do I need to know to start C++

    I've an intro book to C and plan to read another "Understanding C" a Sams book. I've looked at the six books to read as the suggestions for learning C++. Will these books give me a good start into C++ while not losing the foundation of C that I want to be strong in?

  2. #2
    Officially An Architect brewbuck's Avatar
    Join Date
    Mar 2007
    Location
    Portland, OR
    Posts
    7,396
    Quote Originally Posted by Bassglider View Post
    I've an intro book to C and plan to read another "Understanding C" a Sams book. I've looked at the six books to read as the suggestions for learning C++. Will these books give me a good start into C++ while not losing the foundation of C that I want to be strong in?
    If the ultimate goal is to learn C++, just skip C entirely. There's no reason you have to learn C first.

    If you want both, I'd actually start with C++ first and then "back up" to learn C. After learning C++, C will seem stupidly easy.

  3. #3
    Registered User Bassglider's Avatar
    Join Date
    Nov 2007
    Posts
    32
    Will PHP be stupidly easy as well after learning C++?

  4. #4
    Officially An Architect brewbuck's Avatar
    Join Date
    Mar 2007
    Location
    Portland, OR
    Posts
    7,396
    Quote Originally Posted by Bassglider View Post
    Will PHP be stupidly easy as well after learning C++?
    I'd have to take out the "easy" and say that PHP is just plain stupid, but yeah. Similar syntax, just don't expect the object-orientation to be anywhere near as robust or useful as in C++.

  5. #5
    Registered User ssharish2005's Avatar
    Join Date
    Sep 2005
    Location
    Cambridge, UK
    Posts
    1,732
    Will these books give me a good start into C++ while not losing the foundation of C that I want to be strong in?
    If you have basic foundation of C, you wouldn't be find C++ to hard to start. You could just start with C++ straight way.

    ssharish

  6. #6
    Registered User Bassglider's Avatar
    Join Date
    Nov 2007
    Posts
    32
    Thanks Is programming simple applications in Mac vs. Linux vs. Windows something that will be taken into consideration when learning? I would like to know how to program for all OS's. How different are they when you break in down into different OS's?

  7. #7
    Registered User ssharish2005's Avatar
    Join Date
    Sep 2005
    Location
    Cambridge, UK
    Posts
    1,732
    Quote Originally Posted by Bassglider View Post
    Thanks Is programming simple applications in Mac vs. Linux vs. Windows something that will be taken into consideration when learning? I would like to know how to program for all OS's. How different are they when you break in down into different OS's?
    As far i know it not prossible to write a 100% protable software, but till you could write a code which is upto may be 90% protable only if you could follow the standard of C. Have a look at the this link where u will find some links http://home.att.net/~jackklein/c/standards.html

    ssharish

  8. #8
    Registered User
    Join Date
    Dec 2006
    Location
    Canada
    Posts
    3,229
    Thanks Is programming simple applications in Mac vs. Linux vs. Windows something that will be taken into consideration when learning? I would like to know how to program for all OS's. How different are they when you break in down into different OS's?
    If you keep portability in mind, it's very possible and feasible to write code that requires little to no modification to run on different platforms. Make sure you don't use platform dependent APIs (eg. Win32 API, DirectX, Cocoa/Carbon). Use cross-platform libs like Boost, Qt, OpenGL instead.

    Different compilers also have different quirks, but it wouldn't be so much of a problem if you use gcc (and mingw), since it is available on all major platforms.

    Of course, it doesn't apply if you are writing low-level codes. (I have never seen a cross-platform device driver...)
    Last edited by cyberfish; 11-07-2007 at 12:58 AM.

  9. #9
    Registered User Welder's Avatar
    Join Date
    Oct 2007
    Location
    Washington
    Posts
    100
    I would suggest starting with C. It is simpler to learn the basics and will get you rolling a lot faster than C++. C is hard enough as it is for a beginner to jump into and C++ has too many extra things that make it that much harder. Once you get going with C you will be able to jump into C++ fairly seamlessly with a few tutorials and some tinkering.

  10. #10
    Registered User
    Join Date
    Dec 2006
    Location
    Canada
    Posts
    3,229
    I have to kindly disagree with Welder. I think C++ is easier with its well-encapsulated libraries. For instance, I think string manipulation (using std::string) in C++ is a lot easier than working with char arrays. I also find iostreams (cin, cout) easier to work with as a beginner than their C counterparts. Also, data structures like vectors and linked lists are only available in C++.

  11. #11
    Woof, woof! zacs7's Avatar
    Join Date
    Mar 2007
    Location
    Australia
    Posts
    3,459
    > Also, data structures like vectors and linked lists are only available in C++.
    They are!?

  12. #12
    and the hat of sweating
    Join Date
    Aug 2007
    Location
    Toronto, ON
    Posts
    3,545
    Quote Originally Posted by zacs7 View Post
    > Also, data structures like vectors and linked lists are only available in C++.
    They are!?
    Of course. In C, you'd need to allocated/deallocate memory yourself, create linked list structures... It's a pain in the ass compared to STL containers.

  13. #13
    Registered User
    Join Date
    Sep 2006
    Posts
    230
    Is there any reason for someone to learn C after C++? and is C++ that much better for a relatively small program (I'm talking about a program ~800 lines).

  14. #14
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    Is there any reason for someone to learn C after C++?
    Yes. For example, you might need to maintain a C program (there are many of them out there still alive and kicking).
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  15. #15
    Registered User Welder's Avatar
    Join Date
    Oct 2007
    Location
    Washington
    Posts
    100
    Quote Originally Posted by Abda92 View Post
    Is there any reason for someone to learn C after C++? and is C++ that much better for a relatively small program (I'm talking about a program ~800 lines).
    C is the foundation of C++. I use both when I program but I try to focus on C primarily. I started with C 9 years ago and really don't want to change over completely. Kind of like how some people still use PASCAL.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Data Structure Eror
    By prominababy in forum C Programming
    Replies: 3
    Last Post: 01-06-2009, 09:35 AM
  2. Adventures in labyrinth generation.
    By guesst in forum Game Programming
    Replies: 8
    Last Post: 10-12-2008, 01:30 PM
  3. C++ gui for windows where to start
    By prixone in forum Windows Programming
    Replies: 2
    Last Post: 12-16-2006, 11:48 PM
  4. GNOME Desktop won't start (Mandriva)
    By psychopath in forum Tech Board
    Replies: 10
    Last Post: 07-19-2006, 01:21 PM
  5. Start bar color in WinXP
    By confuted in forum Tech Board
    Replies: 4
    Last Post: 05-03-2003, 06:18 AM