

The C Book (HTML Book on C) - mahmud
http://www.phy.duke.edu/~rgb/General/c_book/c_book/index.html

======
vog
It's always great when a good book is released under a free license. This
should be the normal case for all books that are out of print.

Unfortunately, most books simply vanish and/or have an unclear legal status.

------
telemachos
A quick question: the book (at least early on) advocates this for main:

    
    
        # implied int; implied void
        main() {
            # whatever
            exit(0) # or EXIT_SUCCESS
        }
    

Is this simply a stylistic choice (rather than a more explicit _int
main(void)_ and _return(0)_ ). I'm mostly curious, but I know that how to deal
with _main_ can be a sacred cow.

 _Edit_ : And sure enough _clang_ (by default) and _gcc_ (with _-Wall_ ) both
issue warnings.

~~~
johnswamps
The book was written 20 years ago, before the C99 spec was released. main()
was acceptable but discouraged in C89, which is why -Wall (or more precisely
-Wimplicit-int) displays a warning. It's disallowed by the C99 spec and will
always give you a warning.

------
kngspook
The OP's link looks like an HTML dump of
<http://publications.gbdirect.co.uk/c_book/> , which I'm pretty sure is the
original...

(And there's also a PDF of all the pages, linked to from the gbdirect version,
<http://publications.gbdirect.co.uk/c_book/the_c_book.pdf> ; for those of you
having trouble with the printer-friendly version.)

------
aarongough
Awesome timing. I'm just starting to contemplate porting the prototype VM i'm
working on to C. Thanks Mahmud! You seem to be coming to the rescue often
these days :-p

~~~
jfr
The book is from 1991, almost 20 years ago. There is a lot of outdated
information. You should perhaps look for something more recent, that covers
C99 and features commonly found on current compilers.

~~~
aarongough
Thanks for the heads-up. Is C really that different now that I need to worry
about it? I have done some work in C++ before, but that was many years ago and
I've grown accustomed to high-level languages...

~~~
mahmud
No it's not that different. GCC still compiles 1978 C.

~~~
aarongough
Good thing I'm using GCC then! Thanks Mahmud!

------
euroclydon
What's up with the printer friendly version? It doesn't work for me.

~~~
telemachos
Good to know it's not just me. (Chrome dev 6.0.458.1 and Safari both no-go on
OSX 10.6.4.)

~~~
MarkBook
Do you have no feelings at all for your fellow man? :(

~~~
telemachos
Misery loves company? More seriously, I take your point. I say that a lot
("Good to know it's not just me."). I'll have to think a little bit more about
_why_.

~~~
MarkBook
I was only kidding Shared joy is a double joy; shared sorrow is half a sorrow

------
wizzard19
Here's the official GNU C book: <http://www.htu.tugraz.at/~past/ctut/ctut.pdf>

