>>7
Probably ISWM, which is highly topical nowadays. Despite a focus on being accessible for inexperienced readers, I suspect it will appeal to veterans as well.
There is no *after* K&R, you cant get higher than that for C
There are some books you should also have on C
-Expert C Programming (aka Deep C Secrets)
-C Unleashed (out of print)
-C: a Reference Manual (Harbison/Steele)
>>11
The book was meant to be funny because people learning an advanced systems language like C as a first language often is funny. Sort of like people learning to fly without going to ground school first, you can imagine the results of people learning theory of aerodynamics and mechanics of engine handling by hands on experience rather than being taught the theory beforehand.
Name:
Anonymous2010-09-02 13:10
Funny thing is most WW2 pilots learned exactly that way.
Most people learn to drive the same way too.
Dry theory is a great way to kill interest in people. Hands on however fires their interest, and makes them more willing to sit through the major boring shit later.
for example, in the tutorial chapter the output for the fahrenheit/celsius program is wrong. it starts with 1 whereas it should start with 0
or look at this line: You should note carefully
that '\n' is a single character, and in expressions is just an integer; on the other hand, '\n' is
a string constant that happens to contain only one character.
Name:
Anonymous2010-09-02 21:14
>>16,19
I'm guessing you guys downloaded the shitty typed-up-in-WOrd version instead of the LaTeX typeset one or the scan.
Name:
Anonymous2010-09-02 21:20
>>19 for example, in the tutorial chapter the output for the fahrenheit/celsius program is wrong. it starts with 1 whereas it should start with 0
(pg #12)
no its not, fahr is the increment variable, its instantiated with the variable lower and lower is instantiated with 0
or look at this line: You should note carefully that '\n' is a single character, and in expressions .... blah
>>21 '\n' is a char, which in C is just an integer-type, and therefore yields an integer-value when being evaluated.
the statement, though, that '\n' is "on the other hand a string constant that happens to contain only one character." is just wrong. the only string-constant that only contains one charactar in C is "", which contains '\0' as its only element of type char.
Name:
Anonymous2010-09-02 21:32
>>21
the program itself isn't wrong, but the example output they printed, right after "1.2 Variables and Arithmetic Expressions" the first line is
1 -17
instead of
0 -17
and the second '\n' should be "\n"
Name:
Anonymous2010-09-02 21:35
>>22
actually the statement is right apart from the quotes, since a c string is always 0 terminated. so the zero length string is "" or { 0 } in array notation. the 0 termination itself isn't part of the c string by definition.
Name:
Anonymous2010-09-02 21:51
>>22
'\n' is a char data type which is one byte long, it is not equal to an int
"" is not a char but an array of chars with only the terminating /n
Name:
Anonymous2010-09-02 22:03
K&R is written by the people who invented C
It has no mistakes
The implementations have mistakes
Name:
Anonymous2010-09-02 22:04
>>22
I want to further point out that K&R is a book for teaching experienced programmers how to use C well, its not for someone new to this kind of low level programming. I recommend "C Primer Plus" or "Beginning C from Novice to Professional" for someone new to programming.
>>25
A char is not guaranteed to be one byte long (the only thing the standard guarantees is that it can take at least 255 different values), and nobody is saying it's ``equal to an int''.
A string literal is not strictly the same thing as an array of chars with a terminating '\0' (which I assume is what you meant when you said ``/n'').
If people bought their books instead of all downloading the same crappy PDF scan we wouldn't even be having this discussion.
>>29
In fact, a char is the smallest addressable datatype in C (on your CPU, in fact) and therefore always equal to a byte!! What that means is, that a byte does not neccessarily contain 8 bits.
Also, ever wondered why sizeof (char) is defined to be 1?
Name:
Anonymous2010-09-02 22:12
>>29
A char is guaranteed to be one byte. However, one byte isn't guaranteed to be 8 bits.
>>31-32
Both of you need to read the standard. It's true that a byte is not guaranteed to be eight bits, but a char is not defined to be a byte either.
6.5.3.4p2 "The sizeof operator yields the size (in bytes) of its operand [...]." 6.5.3.4p3 "When applied to an operand that has type char, unsigned char, or signed char, (or a qualified version thereof) the result is 1."
Now kindly fuck off, ``faggot''.
Name:
Anonymous2010-09-02 22:20
char is not guaranteed to be exactly 8 bits but as >>29 said it is guaranteed to be AT LEAST 8 bits.
Name:
Anonymous2010-09-02 22:27
I was in Barnes & Noble the other day buying some books and I realized I didn't have a copy of K&R around anymore. I picked up the book along with a few others and went up to the check out. I could not believe it when they rang the book up for 60 fucking dollars. Just for fun I compared this book to the Programming Python book located nearby on the shelf, which is more than 1100 pages-- a massive reference book produced fairly recently (more recently than K&R C anyway). By comparison, this book was barely a scrap of Programming Python, and yet they want 60$ for it. Sucks for Barnes and Noble, they could have sold me that book for 30 dollars which is probably more than its worth in the grander scheme of things anyway, but instead they tried to rape me for buying an old classic book to brush up on my C. Shameful. Can you imagine if they wanted like 60$ for Hamlet or something? That's what it felt like.