PDA

View Full Version : What's your best book about The C programming Language?



honeybear
January 20th, 2013, 02:26 PM
Hello,

I would like to ask you what is the best ever book you have read about Language C or that you might recommend reading?

Please one single book per post (to be the best ever in your opinion)?

Regards

/* EDIT: we talk about C for compilers such as GCC, Borland C, ... (we do NOT talk about C++, C#...) */

Bachstelze
January 20th, 2013, 03:28 PM
The only book I have ever read about C is K&R, and I haven't even read all of it. C is a small language and IMO a book is not at all necessary to learn it. And I am a very bookish person in general.

ofnuts
January 20th, 2013, 05:06 PM
K&R too... but I read all of it.

KdotJ
January 20th, 2013, 05:21 PM
Another one here for K&R... but was more of a reference.

I book at I used a little bit while ar university was a (prior edition) of this book (http://www.amazon.com/How-Program-7th-Deital/dp/013299044X), which I found fairly helpful and it used good examples.

slickymaster
January 20th, 2013, 05:37 PM
Another one here for K&R... but was more of a reference.

Exactly. +1

MG&TL
January 20th, 2013, 06:16 PM
Uhuh. K&R too. It's not exactly up-to-date, but it's the best one I've found and anything you need clarification on you can google.

ehrt74
January 21st, 2013, 11:11 AM
C has some overloaded syntax which makes life difficult, and a book can help get a grasp of it.

For example, the asterisk has at least 3 distinct meanings. It either means "I'm defining something to be a pointer" or "I'm following a pointer to where it points to" or "I'm multiplying 2 numbers". The word 'static' is another example.

What I like about C is that if you understand a bit about how a computer physically works then C isn't a great stretch. It's usually quite simple to understand "what's going on". For this reason, it was the first language that made sense to me (after having spent months trying to understand Java and getting nowhere).

One day I started working on a book I downloaded somewhere online. I tried recently to find the book for a friend and couldn't find it anywhere, I'm afraid. The book didn't follow best practices anyway (it suggested casting mallocs, for example), but it was perfect for me to get into programming.

Warren Hill
January 21st, 2013, 11:54 AM
The only book I still use is

The C Programming language

by Kernighan and Ritchie

trent.josephsen
January 21st, 2013, 03:25 PM
C has some overloaded syntax which makes life difficult, and a book can help get a grasp of it.

For example, the asterisk has at least 3 distinct meanings. It either means "I'm defining something to be a pointer" or "I'm following a pointer to where it points to" or "I'm multiplying 2 numbers". The word 'static' is another example.

The first two "meanings" are the same, syntactically. That's what "declaration mimics use" means. One of the things I hate about most languages that attempt to "improve" C is that they all introduce new and mutually incompatible declaration syntax.


int *ip; // *ip is an int; therefore ip is a pointer-to-int
f(*ip); // f is a function that takes an int

You're right about "static", though. "extern", too.

honeybear
January 21st, 2013, 05:40 PM
I must say even the use of :

char *variable;
char *variable;
char variable[] = "bla";
char variable[254];

is pretty confusing since they all are closely same but havent same purposes.

As the thing with your '*' that does many things


To me, one good boot that I read stuffed with lot of examples and details of the commands is this one:
http://www.bookeo.fr/Turbo-C_a79.html

you can't find it anymore

JDShu
January 21st, 2013, 09:25 PM
As an alternative to K&R, you can also check out Learn C the Hard Way by Zed Shaw. It's free (http://c.learncodethehardway.org/book/) so no harm in doing so. There's even a critique of K&R.
(http://c.learncodethehardway.org/book/krcritique.html)
As a disclaimer, I haven't actually read either book, but Learn Python the Hard Way is pretty good and Shaw seems like he knows what he's talking about even if he's opinionated.

Gyokuro
January 21st, 2013, 09:37 PM
At university K&R is standard lecture but here another one: The C Book (http://publications.gbdirect.co.uk/c_book/), you can even download it.

honeybear
January 24th, 2013, 08:49 PM
In some other forms. I must say that this tutorial is pretty cool:
http://www.iu.hio.no/~mark/CTutorial/C-Tut-4.02.pdf

Bachstelze
January 24th, 2013, 09:09 PM
In some other forms. I must say that this tutorial is pretty cool:
http://www.iu.hio.no/~mark/CTutorial/C-Tut-4.02.pdf

Really? It doesn't seem to provide anything more than others, and its code is written in very old (and bad) style.

honeybear
January 25th, 2013, 04:01 AM
Really? It doesn't seem to provide anything more than others, and its code is written in very old (and bad) style.

Thanks for your comments.

dwhitney67
January 25th, 2013, 11:58 AM
In the 4 days that this thread has been open, I could've learned C (if I did not already know it).

Gaining good programming experience, on the other hand, will take much longer... years in fact.

Bachstelze
January 25th, 2013, 03:15 PM
Gaining good programming experience, on the other hand, will take much longer... years in fact.

It also takes a willingness to learn how to code well, after having learned how to code.

ofnuts
January 25th, 2013, 05:40 PM
It also takes a willingness to learn how to code well, after having learned how to code.

I don't think it's a problem of willingness. My experience with numerous programmers is that they all code decently according to their own standards. The problem is that some have fairly low standards. It's a bit like the lady who did the "potato Jesus" (http://en.wikipedia.org/wiki/Potato_Jesus) :)

Bachstelze
January 25th, 2013, 05:55 PM
I don't think it's a problem of willingness. My experience with numerous programmers is that they all code decently according to their own standards. The problem is that some have fairly low standards. It's a bit like the lady who did the "potato Jesus" (http://en.wikipedia.org/wiki/Potato_Jesus) :)

If you don't code well, at some point someone will tell you. I define "willingness to learn" by whether you listen to them, no matter how rude they are.