Page 1 of 2 12 LastLast
Results 1 to 10 of 19

Thread: What's the best way to learn C?

  1. #1
    Join Date
    Dec 2005
    Location
    Mississauga, ON, Canada
    Beans
    245
    Distro
    Kubuntu 6.10 Edgy

    What's the best way to learn C?

    I'm really interested in learning just C before I go onto C++, so that I have a better background on the whole language. I have some experience in Java and VB so I understand most of the OO concepts. Any suggestions of books or websites would be appreciated. I learned most of my Java from Sun's Beginner documentation so anything along those lines I find myself to be comfortable with.

  2. #2
    Join Date
    Nov 2004
    Beans
    2,614

    Re: What's the best way to learn C?

    Learn C is not the path to C++. The languages share nothing in common besides some syntax.

    Just learn C++. Thinking in C++ is available for free online, but I really recommend Accelerated C++ for a book.

  3. #3
    Join Date
    Apr 2005
    Location
    Sweden
    Beans
    380
    Distro
    Dapper Drake Testing/

    Re: What's the best way to learn C?

    I agree. The problem with C++ for most people is to "forget" how they used to program in C and adapt to the OO way of thinking. If learning C++ is your goal, then start with C++. I'd say that it's not more difficult than C, just different (and in a lot of ways easier, actually).

    If you really want to learn another language before starting with C++, I think Java is a much better choice.
    Software Failure. Press left mouse button to continue.
    Guru Meditation #00000000.48454C50

  4. #4
    Join Date
    Mar 2005
    Location
    Dunedin, NZ
    Beans
    559
    Distro
    Kubuntu 7.10 Gutsy Gibbon

    Re: What's the best way to learn C?

    Another vote to learn C++ not C if C++ is your destination.

    I also recommend "Accelerated C++" by Koenig and Moo.
    ACCU - for programmers who care

  5. #5
    Join Date
    Jan 2006
    Location
    Baltimore
    Beans
    122

    Re: What's the best way to learn C?

    C is a wonderful language to learn for its own merit. But if you want to learn C only so that it would help you to learn C++, then I suggest you start with C++ directly.
    To understand recursion you must understand recursion

    http://krishnamurthy.net.in

  6. #6
    Join Date
    Dec 2005
    Location
    Mississauga, ON, Canada
    Beans
    245
    Distro
    Kubuntu 6.10 Edgy

    Re: What's the best way to learn C?

    I want to learn C so that I can use it if need it. I know that it is used in programming some drivers and embedded systems. A friend of mine also told me that having a good understanding of both languages can help when designing an application.

  7. #7
    Join Date
    Nov 2004
    Beans
    2,614

    Re: What's the best way to learn C?

    Quote Originally Posted by LordRaiden
    I want to learn C so that I can use it if need it. I know that it is used in programming some drivers and embedded systems.
    Yes, but the point is, if you want to learn C, learn C. If you want to learn C++, learn C++. They're essentially two totally different languages except for syntax.

    A friend of mine also told me that having a good understanding of both languages can help when designing an application.
    I would suggest your friend doesn't know what he's talking about, unless you're intentionally designing C++ code for access from C or similar.

  8. #8
    Join Date
    Jan 2005
    Location
    Toronto, Ontario, Canada
    Beans
    2,204

    Re: What's the best way to learn C?

    if you know c++ you can usualy figure out c, but it is harder the otheway around however it can be done.
    Edward A Robinson -- www.earobinson.org

  9. #9

    Re: What's the best way to learn C?

    I won't try to sway you from your position of learning C first, as I did the same thing. I was in a very similar position as you, but only knew Java. Unlike the other posters, I believe that it is an acceptable path. However, I certainly agree with them that if you do not plan to use C, then don't learn it.

    After stopping and starting with other books, I am certain that "The C Programming Language" by Brian Kernighan and Dennis Ritchie is an excellent way to learn C if you know a language already. Concern yourself with the the first seven chapters and just simply read the last one. The exercises aren't terribly interesting, but doing a couple per chapter wouldn't hurt.

    When you are done with that, learn how to use GNU Make or scons for automating your builds. Make certain to know how to separate properly into header files and source files.

    Next, when moving on to C++, find a nice tutorial. I learn from books and therefore chose Steve Oualline's "Practical C++ Programming." Using a web tutorial would be fine. You should ultimately get Bjarne Stroustrup's "The C++ Programming Language."

    Please note that C++ is huge. It is impractical to consistently use the entire language. Write good code using what you know, and don't shy away from virtual functions and other heavily OOP C++.

    Good luck!

  10. #10
    Join Date
    Aug 2005
    Location
    The Local Group
    Beans
    631

    Re: What's the best way to learn C?

    I recommend the book Teach Yourself C in 21 Days by Sam's Publishing.

    Given what you have said, that you want to learn both C and C++, I agree with your proposal to learn C first and then to tackle C++. The reasons are (1) your C knowledge won't be wasted in C++, since the C language is (essentially) a subset of C++; (2) C is much simpler than C++ and will be easier to learn. Knowing C will help you learn C++. C++ programming style is a lot different from C style, but you shouldn't have much trouble with that, coming from an OO background.

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

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