5

This reply to the question "I don't know C. And why should I learn it?" has me interested in learning C. What is a good self-instruction program (textbook/website/OpenCourseWare, etc.) for someone who already has lots of experience in high-level languages?

RexE
  • 239
  • 2
  • 10

3 Answers3

19

This is a clichéd answer, but my intro to C programming was Kernighan and Richie's The C Programming Language.

mipadi
  • 7,493
  • 36
  • 35
  • 1
    No question this is the best resource to start with. – Dave Kincaid Dec 22 '10 at 22:29
  • 1
    this is without question the best resource out there. thin, small, to the point. if you're experienced you'll know C in a few hours and instantly understand where all that stuff in the language you're using now came from. very informative. – Dr. McKay Dec 22 '10 at 23:15
  • The only drawback to using K&R2 is that it doesn't cover the C99 standard. Since C99 support is still somewhat spotty (glares at Microsoft), this may or may not be an issue. My day-to-day reference is Harbison & Steele's "C: A Reference Manual"; it's not a great *teaching* reference, but it will make an indispensable companion reference. – John Bode Dec 23 '10 at 00:21
  • Just to echo what the others have said, this book is essential reading, for anyone, far more so for learning C. – Orbling Dec 23 '10 at 00:34
  • Buy: http://www.amazon.co.uk/C-Programming-Language-2nd/dp/0131103628 – Orbling Dec 23 '10 at 00:37
1

If your goal truly is to understand what goes on under the hood, then perhaps, instead of learning C and writing a toy program in it, you instead look at a C compiler and understand how that works. As far as compilers go, a C compiler is one of the simplest, as the language doesn't have all that many high-level features.

As for which compiler, I would take a simple compiler with an easy to understand machine architecture, so you're not mucking about too much with x86 instructions.

I'd suggest the C-- compiler (written in Java) which outputs MIPS assembly.

Neal Tibrewala
  • 1,073
  • 7
  • 12
0

Leendert Ammeraal's "C For Programmers", while VERY dated now (15 years old or more) is by far the best thing I have ever seen along these lines.

John R. Strohm
  • 18,043
  • 5
  • 46
  • 56