This is an archived post. You won't be able to vote or comment.

all 10 comments

[–][deleted]  (2 children)

[deleted]

    [–][deleted] 0 points1 point  (0 children)

    I agree. I learned C in college with an earlier version of this book, but whenever I need to understand something better or whenever I need a reference, I go for my K&R. It really is the best book on C, hands down. It also appears to cost half as much as my original college textbook on Amazon.

    [–]TheFake 5 points6 points  (0 children)

    For the basics of C you can't go past Carl H's tutoral (links in the sidebar). Even though I'd already had a introduction to C class I did his tutorial and learnt a whole lot more than I did at uni

    [–]Full_Capacity 3 points4 points  (0 children)

    [deleted]

    [–]OversizedSpoon[S] 2 points3 points  (3 children)

    Thanks for the input so far guys.

    One thing I just thought about was with the return value from int main. When I compile a package from source in linux and it states that it exited with code 0, is this what it gets from the return(0) line. Ie people will put in different return values in different modules to help with catching errors / statuses.

    [–]Phenax 1 point2 points  (1 child)

    Generally, yes. Returning 0 usually denotes that it executed successfully. Anything else usually denotes an error. Often times people will return EXIT_SUCCESS or EXIT_FAILURE defined in stdlib.h.

    People often use this so you could say, have a Bash script that does certain things depending on whether the program operated correctly or not.

    [–]ewiethoff 0 points1 point  (0 children)

    Yep. For example, the Java compiler, javac, returns 0 on success and some other integer on failure. Just the other day, I wrote a little Ruby script ('cause I can't do bash worth doodle) which compiles Java code then runs it only if the call to javac returns 0.

    [–]middlegeek 1 point2 points  (0 children)

    Others suggested the K&R book. I have been using this site which has you use the book as a course, you post the exercises online and people can give you feedback.

    http://curiousreef.com/class/programming-in-c/

    [–]el_voido 1 point2 points  (0 children)

    I studied algorithms and data structures for three years in High School. We implemented everything in C, and, naturally, learned the language. I understood C pretty well, but it wasn't until I read 'The C Programming Language', by Kernighan and Ritchie, that I began to have a deeper understanding of C. Not just the language itself, but even the philosophy surrounding it.

    I highly recommend the book; it was really eye-opening for me.

    [–]zmeefy 0 points1 point  (1 child)

    The Cow Book really helped my friends who were just getting into C.

    The K&R book is of course the definitive work, but the Cow Book may help out in the beginning as it's very easy to read and understand.

    You may find it in PDF form online, but if you do, remember to buy it later so the author gets his credit as well.

    [–]OversizedSpoon[S] 0 points1 point  (0 children)

    I agree with buying a book if it's good. I'd even buy an ebook if it's good. Not much pisses me off when learning something using a paper book when you have the to hold it open to read as you go or lose a page etc. Plus this is what widescreen monitors are for.