a good C book

Discussion in 'C Programming' started by Rudra Banerjee, Jan 31, 2013.

  1. Hello friends,
    I *really* dont want to flame a war here. But it will be helpful for me if you can suggest a good book for me.
    I am not a novice programmer, using fortan for ~10 years now. But from such higher level language, was never exposed to terms like malloc or buffer :( .
    I have a K&R with me, but felt descriptions are too short for these new ideas.
    I tried my hand with dummies, but that looks like kids play. Today i have collected a book called "C in a nutshell". But thought it will be wiser to ask wiser people.
    I am not looking for the *best* book in the market. Just a moderately helpful one. Or even, if the nutshell worth a try(its from O'Reilly's; by Prinz & Crawford)
    Rudra Banerjee, Jan 31, 2013
    1. Advertisements

  2. Question 18.10 of the comp.lang.c FAQ, http://www.c-faq.com/, has some
    book recommendations, though some of them may be out of date.

    Avoid any books written by Schildt.

    Harbison & Steele's "C: A Reference Manual", now in its 5th edition, is
    a very good reference. It's not a tutorial.

    The FAQ recommends King's "C: A Modern Approach"; I haven't read it myself.

    The ISO C standard is the definitive reference to the language,
    but probably not good for learning (unless your mind is at least
    as twisted as mine). Publicly available drafts for the C99 and
    C11 standards, respectively, are:

    Keith Thompson, Jan 31, 2013
    1. Advertisements

  3. In C the malloc() function does some of what the Fortran ALLOCATE
    statement does. More specifically, the form that allocates for
    pointer variables.

    Sometimes you can read data directly to where you want it to go,
    but sometimes you have to read it in somewhere else first.

    In Fortran, this is sometimes done reading into a CHARACTER
    variable, then using internal I/O to extract the data.
    The CHARACTER variable is then the buffer.

    Otherwise, 10 years of Fortran should make learning most of C
    pretty easy. It helps much if you have a little experience with
    the assembler language (not necessarily using an assembler)
    before learning C. To get used to thinking about data in
    terms of its address helps much.

    -- glen
    glen herrmannsfeldt, Jan 31, 2013
  4. Rudra Banerjee

    Jorgen Grahn Guest

    You bought it; aren't you going to read it?

    I haven't read a book on C for 15 years, but AIUI the "Nutshell"
    series are high-quality books for smart people who aren't novices in
    the general area. Seems like a good description of a Fortran

    Jorgen Grahn, Jan 31, 2013
  5. That's my favorite book about C. Clear writing. Tells it like it is.

    I believe Steele also wrote the Common Lisp manual and the Java manual.
    Well, yeah, but for someone with 10 years programming experience,
    I think it's a good tool for learning.

    - Bob
    Robert A Duff, Jan 31, 2013
  6. Rudra Banerjee


    I'd have a look at Deitel's C - How to Program (2001) 3 Ed
    It is inexpensive and comprehensive.
    , Feb 1, 2013
  7. Please, no, not Schildt!

    The general consensus seems to be that Schildt's books on C are written
    in a very engaging and easy to follow style, and describe a language
    that differs substantially from C. (I have no strong opinion on his
    writing style myself.) If you know the language well, you'll almost
    certainly find a serious error on any given page. That is *not* an

    See <http://www.lysator.liu.se/c/schildt.html> for a review by
    C.D.W. Feather of his book "The Annotated Annotated C Standard", and
    <http://www.seebs.net/c/c_tcn4e.html> for a review by Peter Seebach of
    "C: The Complete Reference".

    At the very least, read those reviews before you consider buying
    anything with Schildt's name on it.
    Keith Thompson, Feb 1, 2013
  8. Rudra Banerjee

    James Kuyper Guest

    On 01/31/2013 07:11 PM, Daniel W. Rouse Jr. wrote:
    No, they are maligned because they contain so many mistakes, some of
    them serious, and also by Schildt's refusal to acknowledge and correct
    those mistakes. That some of those mistakes take the form of being
    accurate statements about Microsoft's implementation of C, that Schildt
    incorrectly describes as if they were true of every implementation of C,
    is a relatively minor aspect of what's wrong with his book.
    James Kuyper, Feb 1, 2013
  9. Rudra Banerjee

    JohnF Guest

    I also learned C after some 10+ years Fortran experience
    (and another ~5 with various assembler languages).
    For me, K&R was far-and-away the very best book
    to get up-and-running with C. I'd suggest you give it
    another try. And, of course, you have to actually write some
    programs. You can't learn any language just reading a book,
    no more than you could learn to play a piano just reading a book.
    In both cases you need to sit down at a keyboard.
    JohnF, Feb 1, 2013
  10. While I agree that K&R is 'the' book to master, I wanted to point to
    this: http://www.mixsoftware.com/product/powerc.htm

    Over the years I saw many recomendations to this package, not because
    of the Power-C compiler itself, but because of the C tutorial book
    that comes with it. (I have not personally used it.)
    Roberto Waltman, Feb 3, 2013
  11. Rudra Banerjee

    Hans Vlems Guest

    My recommendations would be K&R and King's "C: A Modern Approach".
    K&R tries to serve two purposes at the same time, to teach C and
    It does so very well. King presents the language in detail and in
    clear English.
    I've used mainly (Burooughs) Algol, Pascal and a little Ada, Fortran
    IV and VAX assembly and King's book was a great help.
    Hans Vlems, Feb 4, 2013
  12. Rudra Banerjee

    John Bode Guest

    H&S has been my primary reference since the 2nd edition (around 1987 or so).
    Like others have said, it's light on examples and tutorials, but as a
    *reference* manual it's one of the best, if not the best, on the market.
    John Bode, Feb 4, 2013
  13. Rudra Banerjee

    John Bode Guest

    No. Schildt is a *menace*, and has poisoned the minds of a generation
    of programmers.
    They are maligned because they do not describe the language correctly.
    They are maligned because they teach *bad* habits.
    They are maligned because the example code is (or at least was)
    riddled with errors.

    And he didn't *occasionally* use MS-specific extensions in his examples.
    I bought the first edition while in college, and *none* of the examples
    would compile on VMS (almost every example used conio). And, of
    course, since I was still in the process of learning the language along
    with learning how to program in general, I didn't know what was C and what
    was MS-specific, and Schildt didn't bother to point it out.

    There were also some non-trivial logic errors in his examples, such
    as attempting to write to a file after closing it, or accessing data
    through an invalid pointer, etc.

    I picked up the fourth edition of "C: The Complete Reference", and while
    the most obvious howlers had been dealt with, there were still some
    mistakes that shouldn't have survived to the second edition, much less the
    John Bode, Feb 4, 2013
  14. Rudra Banerjee

    Hans Vlems Guest

    For (VAX/)VMS specific examples I still use "Programming in VAX-11 C".
    It was printed in May 1982 and is not exactly cutting edge technology,
    even for VMS.
    Still useful as an introduction to RMS programming though.
    Hans Vlems, Feb 4, 2013
  15. RMS being VMS's Record Management Services, for those who are unfamiliar.
    Keith Thompson, Feb 5, 2013
  16. Rudra Banerjee


    read the C FAQ when an issue is unclear.
    Plus there are C tutorials where you can go at your own pace.

    Avoid Schildt. I had him as a C++ instructor and we were using his C++ and it was riddled with errors. His excuse was it keeps you on your toes. He also blamed his editor. He came to class on his motorcycle and wore his leather jacket. He even handed out correction sheets to pages in the books for serious errors.

    Not as bad as the professor that said "You should never need more than twenty six variables so just use the letter as a variable name.
    Not as bad as the purple project (all branches of the government and I had the program running. Then I get this roll of paper that is thirty feet long and five feet deep from the sponsor. To keep all of the variables happy in their land was to name them with seventy eight long character names. Thank God for search and replace.

    This was the same project that my manager deleted all the graphing setup since he said "This is OO it has default values. What a Hoser.
    , May 4, 2014
  17. Rudra Banerjee

    buja Guest

    Op zondag 4 mei 2014 01:39:52 UTC+2 schreef :
    I would like to mention 3 books:
    A. C Programming: A Modern Approach, K.N. King (already mentioned above)
    B. Programming in C, Stephen G. Kochan
    C. Pointers in C, Y. Kanetkar

    A and B are good and very similar books about programming in C. King decomposes stuff a bit more, making it a bit easier. While most books refer to C89, these books take it up to C99.
    Book C is a strange one. It goes back on Turbo C on DOS, although its firstedition is from 2001. I sometimes have my doubts about the writing style (but I am not a native English speaker) and what it says (some weird constructs I would not use myself), but the book excels with its example programs:91 complete programs that work (as opposed to the usual bits and pieces inmost other books).
    It might be something for Bill Cunningham ;)
    buja, May 4, 2014
  18. Rudra Banerjee

    buja Guest

    He came to class on his motorcycle and wore his leather jacket.

    What is the problem with that? I would consider that a plus!
    buja, May 4, 2014
  19. Rudra Banerjee

    G G Guest

    how about " C How To Program",Deitel and Deitel

    and with that book, use this group, because they do a great job of explaining what may be out of date or out of spec.

    it seems to be an easy read.

    "Head First C" is another easy read.

    with those easy reads and group you'll move really quickly. but, great books, i would say they are not.

    C Programming A Modern Approach.
    G G, May 5, 2014
  20. It might be something for Bill Cunningham ;)

    No. Nah. I'm told these books are all wrong. Throw them away.
    Bill Cunningham, May 6, 2014
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.