Fog Creek Software
Discussion Board




Learning C

I have been developing in Perl and Java for the past five years and now I decided it was time to learn the basics. I know all the theory behind pointers and malloc() and free() but I've never done anything in C.

Do you know of any good books that teach C? Something extremelly heavy on the practice part, not just what can be found on the K&R book.

Thanks a lot

Mary Ann
Tuesday, April 13, 2004

You want to do that just for the heck of it? Or is there a profession related reason?

If you just want to learn 'close to the machine', I'd recommend assembly over C.

  
Tuesday, April 13, 2004

alas I didn't answer your question.

"The C Programming Language" K&R.

  
Tuesday, April 13, 2004

You'll have trouble finding more practice than in the K&R book.  It has a very comprehensive set of exercises that you should really try working through.  I believe that there are answer keys that are available for purchase, so you can see and correct mistakes.  Although I already knew C when I picked this book up at the suggestion of a supervisor, I found it to be immensely helpful in getting a better grasp on the language.

It does suffer from the fact that it's using typography from the 1970s, where modern books tend to be long on sidebars and lots of colorful things. None of them have made the language as clear as this book made it for me.

Clay Dowling
Tuesday, April 13, 2004

Where's Ginger?

SheKaKa
Tuesday, April 13, 2004

> Do you know of any good books that teach C? Something
> extremelly heavy on the practice part, not just what can
> be found on the K&R book.

"Teaching C" is different than "using C". The books that teach you what it is will not necessarily be heavy on the practice side. There are other books for that which teach you pragmatic programming in C, Perl, whatever...

Therefore there is no one single book that'll show you everything in C or anything else. That's never the case anyway. You'll have hunt your information.

grunt
Tuesday, April 13, 2004

One of my favorite C books after K&R is "Expert C Programming , Deep C Secrets" by Peter van der Linden. It covers some of the stranger things in greater detail....

SG
Tuesday, April 13, 2004

More suggestions in the "Pointers on Pointers" thread from a few months back:

http://discuss.fogcreek.com/newyork/default.asp?cmd=show&ixPost=2049

- former car owner in Queens
Tuesday, April 13, 2004

http://www.accu.org/bookreviews/public/reviews/0sb/advanced_c.htm#recbook

Nick
Tuesday, April 13, 2004

> You'll have trouble finding more practice than in the K&R book.

Yeah, one-letter variable names and buffer overflows in almost every example. It'll get you writing buggy, exploitable, hard-to-read code in no time.

Mary, what you want is the book recommended in that other topic, Practical C Programming by Steve Oualline.

It makes C fun and has a lot of practical examples in it. Take a look at it and read the reviews: http://www.oreilly.com/catalog/pcp3/

To the rest of you: why on earth do you keep recommending K&R over and over again? The book is 20+ years old and demonstrates in virtually all of its examples an unsafe coding style that's been unacceptable for a decade. There are better C books out there.

The Iron Fisted Hotdog and Pretzel Baron of Fulton County
Tuesday, April 13, 2004

I simply like it! The first time I read it, I felt joyful as my lecturer recommended Deitel book which killed my appetite.

The book is wonderful, puzzling, straight-to-the-point, and still the best!

Richard Sunarto Yu
Tuesday, April 13, 2004

For all its faults, I still highly recommend the K&R book. I'd also pick up something a little more modern though, maybe C Primer Plus?

  
Tuesday, April 13, 2004

I also like the K&R books. There are some good tutorials on the web as well. Of course, nothing will work better than actually downloading some good code and reading it.

Jonas B.
Tuesday, April 13, 2004

Also go download and use the C interpreter @

http://root.cern.ch/root/Cint.html

IT makes C programming that much more enjoyable and immediate during the early learning phase

Code Monkey
Tuesday, April 13, 2004

read com.lang.c

Tom Vu
Tuesday, April 13, 2004

I recommend C for Dummies and I think you are correct in wanting to learn C, even though you may never need it. It's hard to really make sense out of Perl or Java without knowing exactly what they evolved from.

The Real PC
Wednesday, April 14, 2004

*  Recent Topics

*  Fog Creek Home