a good C book

R

Rudra Banerjee

Hello friends,
I *really* dont want to flame a war here. But it will be helpful for me if you can suggest a good book for me.
I am not a novice programmer, using fortan for ~10 years now. But from such higher level language, was never exposed to terms like malloc or buffer :( .
I have a K&R with me, but felt descriptions are too short for these new ideas.
I tried my hand with dummies, but that looks like kids play. Today i have collected a book called "C in a nutshell". But thought it will be wiser to ask wiser people.
I am not looking for the *best* book in the market. Just a moderately helpful one. Or even, if the nutshell worth a try(its from O'Reilly's; by Prinz & Crawford)
 
K

Keith Thompson

Rudra Banerjee said:
Hello friends,
I *really* dont want to flame a war here. But it will be helpful for
me if you can suggest a good book for me. I am not a novice
programmer, using fortan for ~10 years now. But from such higher level
language, was never exposed to terms like malloc or buffer :( . I
have a K&R with me, but felt descriptions are too short for these new
ideas. I tried my hand with dummies, but that looks like kids
play. Today i have collected a book called "C in a nutshell". But
thought it will be wiser to ask wiser people. I am not looking for
the *best* book in the market. Just a moderately helpful one. Or even,
if the nutshell worth a try(its from O'Reilly's; by Prinz & Crawford)

Question 18.10 of the comp.lang.c FAQ, http://www.c-faq.com/, has some
book recommendations, though some of them may be out of date.

Avoid any books written by Schildt.

Harbison & Steele's "C: A Reference Manual", now in its 5th edition, is
a very good reference. It's not a tutorial.

The FAQ recommends King's "C: A Modern Approach"; I haven't read it myself.

The ISO C standard is the definitive reference to the language,
but probably not good for learning (unless your mind is at least
as twisted as mine). Publicly available drafts for the C99 and
C11 standards, respectively, are:

http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1256.pdf
http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1570.pdf
 
G

glen herrmannsfeldt

Rudra Banerjee said:
I *really* dont want to flame a war here. But it will be helpful
for me if you can suggest a good book for me.
I am not a novice programmer, using fortan for ~10
years now. But from such higher level language, was never
exposed to terms like malloc or buffer :( .

In C the malloc() function does some of what the Fortran ALLOCATE
statement does. More specifically, the form that allocates for
pointer variables.

Sometimes you can read data directly to where you want it to go,
but sometimes you have to read it in somewhere else first.

In Fortran, this is sometimes done reading into a CHARACTER
variable, then using internal I/O to extract the data.
The CHARACTER variable is then the buffer.

Otherwise, 10 years of Fortran should make learning most of C
pretty easy. It helps much if you have a little experience with
the assembler language (not necessarily using an assembler)
before learning C. To get used to thinking about data in
terms of its address helps much.

-- glen
 
J

Jorgen Grahn

.
I am not looking for the *best* book in the market. Just a
moderately helpful one. Or even, if the nutshell worth a try(its from
O'Reilly's; by Prinz & Crawford)

You bought it; aren't you going to read it?

I haven't read a book on C for 15 years, but AIUI the "Nutshell"
series are high-quality books for smart people who aren't novices in
the general area. Seems like a good description of a Fortran
programmer.

/Jorgen
 
R

Robert A Duff

Keith Thompson said:
Harbison & Steele's "C: A Reference Manual", now in its 5th edition, is
a very good reference.

That's my favorite book about C. Clear writing. Tells it like it is.

I believe Steele also wrote the Common Lisp manual and the Java manual.
...It's not a tutorial.

Well, yeah, but for someone with 10 years programming experience,
I think it's a good tool for learning.

- Bob
 
B

bob

I'd have a look at Deitel's C - How to Program (2001) 3 Ed
It is inexpensive and comprehensive.
 
K

Keith Thompson

Daniel W. Rouse Jr. said:
Anything by Herbert Schildt, I would say.

Often times, Schildt's books are maligned because they occasionally
use Microsoft-specific extensions as opposed to strict ANSI C;
however, books by Schildt are the fastest way to get up to speed
without being riddled with distracting footnotes or more on this later
type of explanations. In Schildt's books, you'll be writing programs
quickly and the explanations are clear enough without being overly
verbose. They tend to be better than the Crash course, or Dummies, or
In 24 hours type of books in terms of completeness of coverage.

Please, no, not Schildt!

The general consensus seems to be that Schildt's books on C are written
in a very engaging and easy to follow style, and describe a language
that differs substantially from C. (I have no strong opinion on his
writing style myself.) If you know the language well, you'll almost
certainly find a serious error on any given page. That is *not* an
exaggeration.

See <http://www.lysator.liu.se/c/schildt.html> for a review by
C.D.W. Feather of his book "The Annotated Annotated C Standard", and
<http://www.seebs.net/c/c_tcn4e.html> for a review by Peter Seebach of
"C: The Complete Reference".

At the very least, read those reviews before you consider buying
anything with Schildt's name on it.
 
J

James Kuyper

On 01/31/2013 07:11 PM, Daniel W. Rouse Jr. wrote:
....
Often times, Schildt's books are maligned because they occasionally use
Microsoft-specific extensions as opposed to strict ANSI C;

No, they are maligned because they contain so many mistakes, some of
them serious, and also by Schildt's refusal to acknowledge and correct
those mistakes. That some of those mistakes take the form of being
accurate statements about Microsoft's implementation of C, that Schildt
incorrectly describes as if they were true of every implementation of C,
is a relatively minor aspect of what's wrong with his book.
 
J

JohnF

Rudra Banerjee said:
I am not a novice programmer, using fortan for ~10 years now.
I have a K&R with me, but felt descriptions are too short
for these new ideas.

I also learned C after some 10+ years Fortran experience
(and another ~5 with various assembler languages).
For me, K&R was far-and-away the very best book
to get up-and-running with C. I'd suggest you give it
another try. And, of course, you have to actually write some
programs. You can't learn any language just reading a book,
no more than you could learn to play a piano just reading a book.
In both cases you need to sit down at a keyboard.
 
R

Roberto Waltman

While I agree that K&R is 'the' book to master, I wanted to point to
this: http://www.mixsoftware.com/product/powerc.htm

Over the years I saw many recomendations to this package, not because
of the Power-C compiler itself, but because of the C tutorial book
that comes with it. (I have not personally used it.)
 
H

Hans Vlems

Hello friends,
I *really* dont want to flame a war here. But it will be helpful for me if you can suggest a good book for me.
I am not a novice programmer, using fortan for ~10 years now. But from such higher level language, was never exposed to terms like malloc or buffer :( .
I have a K&R with me, but felt descriptions are too short for these new ideas.
I tried my hand with dummies, but that looks like kids play. Today i have collected a book called "C in a nutshell". But thought it will be wiser to ask wiser people.
I am not looking for the *best* book in the market. Just a moderately helpful one. Or even, if the nutshell worth a try(its from O'Reilly's; by Prinz & Crawford)

My recommendations would be K&R and King's "C: A Modern Approach".
K&R tries to serve two purposes at the same time, to teach C and
programming.
It does so very well. King presents the language in detail and in
clear English.
I've used mainly (Burooughs) Algol, Pascal and a little Ada, Fortran
IV and VAX assembly and King's book was a great help.
Hans
 
J

John Bode

[snip]

Harbison & Steele's "C: A Reference Manual", now in its 5th edition, is
a very good reference. It's not a tutorial.

H&S has been my primary reference since the 2nd edition (around 1987 or so).
Like others have said, it's light on examples and tutorials, but as a
*reference* manual it's one of the best, if not the best, on the market.
 
J

John Bode

[snip]

Anything by Herbert Schildt, I would say.

No. Schildt is a *menace*, and has poisoned the minds of a generation
of programmers.
Often times, Schildt's books are maligned because they occasionally use
Microsoft-specific extensions as opposed to strict ANSI C;

They are maligned because they do not describe the language correctly.
They are maligned because they teach *bad* habits.
They are maligned because the example code is (or at least was)
riddled with errors.

And he didn't *occasionally* use MS-specific extensions in his examples.
I bought the first edition while in college, and *none* of the examples
would compile on VMS (almost every example used conio). And, of
course, since I was still in the process of learning the language along
with learning how to program in general, I didn't know what was C and what
was MS-specific, and Schildt didn't bother to point it out.

There were also some non-trivial logic errors in his examples, such
as attempting to write to a file after closing it, or accessing data
through an invalid pointer, etc.

I picked up the fourth edition of "C: The Complete Reference", and while
the most obvious howlers had been dealt with, there were still some
mistakes that shouldn't have survived to the second edition, much less the
fourth.
 
H

Hans Vlems

[snip]

Anything by Herbert Schildt, I would say.

No.  Schildt is a *menace*, and has poisoned the minds of a generation
of programmers.


Often times, Schildt's books are maligned because they occasionally use
Microsoft-specific extensions as opposed to strict ANSI C;
_<

They are maligned because they do not describe the language correctly.
They are maligned because they teach *bad* habits.
They are maligned because the example code is (or at least was)
riddled with errors.

And he didn't *occasionally* use MS-specific extensions in his examples.
I bought the first edition while in college, and *none* of the examples
would compile on VMS (almost every example used conio).  And, of
course, since I was still in the process of learning the language along
with learning how to program in general, I didn't know what was C and what
was MS-specific, and Schildt didn't bother to point it out.

There were also some non-trivial logic errors in his examples, such
as attempting to write to a file after closing it, or accessing data
through an invalid pointer, etc.

I picked up the fourth edition of "C: The Complete Reference", and while
the most obvious howlers had been dealt with, there were still some
mistakes that shouldn't have survived to the second edition, much less the
fourth.

For (VAX/)VMS specific examples I still use "Programming in VAX-11 C".
It was printed in May 1982 and is not exactly cutting edge technology,
even for VMS.
Still useful as an introduction to RMS programming though.
Hans
 
K

Keith Thompson

Hans Vlems said:
For (VAX/)VMS specific examples I still use "Programming in VAX-11 C".
It was printed in May 1982 and is not exactly cutting edge technology,
even for VMS.
Still useful as an introduction to RMS programming though.

RMS being VMS's Record Management Services, for those who are unfamiliar.
 
E

encode2.tevans

Hello friends,

I *really* dont want to flame a war here. But it will be helpful for me if you can suggest a good book for me.
read the C FAQ when an issue is unclear.
Plus there are C tutorials where you can go at your own pace.

Avoid Schildt. I had him as a C++ instructor and we were using his C++ and it was riddled with errors. His excuse was it keeps you on your toes. He also blamed his editor. He came to class on his motorcycle and wore his leather jacket. He even handed out correction sheets to pages in the books for serious errors.

Not as bad as the professor that said "You should never need more than twenty six variables so just use the letter as a variable name.
Not as bad as the purple project (all branches of the government and I had the program running. Then I get this roll of paper that is thirty feet long and five feet deep from the sponsor. To keep all of the variables happy in their land was to name them with seventy eight long character names. Thank God for search and replace.

This was the same project that my manager deleted all the graphing setup since he said "This is OO it has default values. What a Hoser.
 
B

buja

Op zondag 4 mei 2014 01:39:52 UTC+2 schreef (e-mail address removed):
read the C FAQ when an issue is unclear.

Plus there are C tutorials where you can go at your own pace.



Avoid Schildt. I had him as a C++ instructor and we were using his C++ and it was riddled with errors. His excuse was it keeps you on your toes. He also blamed his editor. He came to class on his motorcycle and wore his leather jacket. He even handed out correction sheets to pages in the books forserious errors.



Not as bad as the professor that said "You should never need more than twenty six variables so just use the letter as a variable name.

Not as bad as the purple project (all branches of the government and I had the program running. Then I get this roll of paper that is thirty feet long and five feet deep from the sponsor. To keep all of the variables happyin their land was to name them with seventy eight long character names. Thank God for search and replace.



This was the same project that my manager deleted all the graphing setup since he said "This is OO it has default values. What a Hoser.

I would like to mention 3 books:
A. C Programming: A Modern Approach, K.N. King (already mentioned above)
B. Programming in C, Stephen G. Kochan
C. Pointers in C, Y. Kanetkar

A and B are good and very similar books about programming in C. King decomposes stuff a bit more, making it a bit easier. While most books refer to C89, these books take it up to C99.
Book C is a strange one. It goes back on Turbo C on DOS, although its firstedition is from 2001. I sometimes have my doubts about the writing style (but I am not a native English speaker) and what it says (some weird constructs I would not use myself), but the book excels with its example programs:91 complete programs that work (as opposed to the usual bits and pieces inmost other books).
It might be something for Bill Cunningham ;)
 
B

buja

He came to class on his motorcycle and wore his leather jacket.

What is the problem with that? I would consider that a plus!
 
G

G G

how about " C How To Program",Deitel and Deitel

and with that book, use this group, because they do a great job of explaining what may be out of date or out of spec.

it seems to be an easy read.

"Head First C" is another easy read.

with those easy reads and group you'll move really quickly. but, great books, i would say they are not.

C Programming A Modern Approach.
 
B

Bill Cunningham

It might be something for Bill Cunningham ;)

No. Nah. I'm told these books are all wrong. Throw them away.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

Forum statistics

Threads
473,734
Messages
2,569,441
Members
44,832
Latest member
GlennSmall

Latest Threads

Top