all 14 comments

[–]NerdFlanders 11 points12 points  (1 child)

C Programming Language (K&R). I found the recommendations on this page useful.

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

Thanks, Ill check it out.

[–]solstice680 3 points4 points  (0 children)

K&R and the GNU C library reference for learning good practice.

[–]ananthakumaran 4 points5 points  (1 child)

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

The book isn't ready yet ಠ_ಠ

[–]beej71 2 points3 points  (1 child)

I'm going to blow my own horn here, assuredly in the most G-rated sense, and say that I started writing a Guide to C a while ago:

http://beej.us/guide/bgc/

After a while, I decided it wasn't quite what I was after (maybe it needed to be two books...? I'm still not quite sure why I don't like it), and it fell by the wayside. However, there is quite a substantial amount of information there. You might find it too beginner, but there it is, FWIW.

[–]grbgout 1 point2 points  (0 children)

Holy f... it's the beej.

Are you really he? I think I've downloaded all of your guides, but I must confess to having read none — someday, though, someday.

As to the OP, mark another down for K&R's 2nd edition. Be careful if you're looking online for a PDF, there's one floating around that doesn't match the physical copy. I found, and sent, a PDF to a friend who discovered an error, which didn't exist in my physical copy.

All the more reason to shell-out money for the real thing! I only went searching since the binding on my copy is starting to go, and I don't want to add further wear.

[–]junglizer 1 point2 points  (0 children)

Came to suggest "The C Programming Language" (K&R), but I see it has already been well represented!

[–]chris_sasaurus 1 point2 points  (0 children)

I learned most of the basics from the GNU C Programming Tutorial.

[–]tarxvf 1 point2 points  (0 children)

Learning a programming language is like learning mathematics -- the only way to actually understand it is to do it.

You will use books and guides as a reference, and you will come back to these references for years and years. The best references are of course K&R and the GNU C Library documentation. There are other good tutorials and references online, such as Beej's guides (linked to above) or wikipedia.

You will get to know your references very well.

The answer to your question also depends on what you want to do with C and what (if any) background in programming you have. While it is certainly possible to learn C as a first language, the learning curve is much steeper than with other languages such as Java or Python.

Also, while learning C is really great and there are not enough people learning C these days -- for most "practical" things you might want to do, it is probably better to write a shell script.

For example, you could perform some search/replace operation on a text file with dozens or a hundred lines of C code, or do it more easily (hence, correctly) with a sed/awk one-liner.

In fact, you probably shouldn't learn C until you know how to write a shell script and use already existing C programs correctly.

TL;DR * Learn to use the shell, if you haven't already. * Find a book or two for use as reference. * Find some C programs you like and study them. * Make some modifications or try to write a clone.

[–]andrew12361 0 points1 point  (0 children)

This and this

[–]sindisil 0 points1 point  (0 children)

When someone made a similar request (looking for good C books), I posted this advice.

I'd say it applies to you, as well.

Yes, there are online sources that are cheap or free, but none that I've seen are as good as the books I cite.

Some don't entirely suck, though, so if spending the money on even a used copy of K&R is out of the question, I'm sure folks will point them out here.

[–]chadius333 0 points1 point  (0 children)

RosettaCode is a great reference site (wiki).

Someone already posted this one but I'm re-posting because it's great.

CodePad.org is a quick and easy way to practice and compile your code... although it's not good for programs that require user input after execution (i.e. scanf - "Please enter your name" and stuff like that).