News for hackers. Stuff that matters.
Re:The C Book (HTML Book on C) by vog on Saturday July 10, 2010 @06:52AM (#1503475)
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.

Re:The C Book (HTML Book on C) by telemachos on Saturday July 10, 2010 @01:25PM (#1503991)
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.

Re:The C Book (HTML Book on C) by johnswamps on Saturday July 10, 2010 @01:56PM (#1504052)
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.
Re:The C Book (HTML Book on C) by kngspook on Saturday July 10, 2010 @08:30PM (#1504619)
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.)

Re:The C Book (HTML Book on C) by aarongough on Saturday July 10, 2010 @10:14AM (#1503659)
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
Re:The C Book (HTML Book on C) by jfr on Saturday July 10, 2010 @12:13PM (#1503868)
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.
Re:The C Book (HTML Book on C) by timthorn on Saturday July 10, 2010 @03:26PM (#1504195)
I was given this book for my 15th birthday - it rescued me from Sinclair Basic! It may be old but it's a very readable C tutorial and won't lead people far astray.
Re:The C Book (HTML Book on C) by aarongough on Saturday July 10, 2010 @01:01PM (#1503949)
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...
Re:The C Book (HTML Book on C) by jfr on Saturday July 10, 2010 @02:35PM (#1504119)
In essence, it is the same language, just that it evolved considerably since then. There are places where you could really use a more current reference. For example, the book instructs you to define the main function like:

    main(){
      /* ... */
    }
This is considered bad code style for todays standards. It doesn't state the return value (it defaults to int) and it leaves the argument list open (you can pass any number of arguments to the function).

In other places, it puts restrictions that are no longer relevant today. For example, since C99 (and most compilers allowed this long before C99) you can declare variables anywhere inside a block (which is pretty handy), and not just at the beginning of the function.

Re:The C Book (HTML Book on C) by woadwarrior01 on Saturday July 10, 2010 @04:02PM (#1504245)
Its the same, but C99 adds a couple of neat features like boolean types, variable length arrays, variadic macros, inline functions and a lot more.
Re:The C Book (HTML Book on C) by mahmud on Saturday July 10, 2010 @01:24PM (#1503988)
No it's not that different. GCC still compiles 1978 C.
Re:The C Book (HTML Book on C) by aarongough on Saturday July 10, 2010 @02:14PM (#1504080)
Good thing I'm using GCC then! Thanks Mahmud!
Re:The C Book (HTML Book on C) by euroclydon on Saturday July 10, 2010 @08:39AM (#1503550)
What's up with the printer friendly version? It doesn't work for me.
Re:The C Book (HTML Book on C) by blue1 on Sunday July 11, 2010 @09:50AM (#1505469)
Re:The C Book (HTML Book on C) by telemachos on Saturday July 10, 2010 @09:29AM (#1503606)
Good to know it's not just me. (Chrome dev 6.0.458.1 and Safari both no-go on OSX 10.6.4.)
Re:The C Book (HTML Book on C) by MarkBook on Saturday July 10, 2010 @11:02AM (#1503731)
Do you have no feelings at all for your fellow man? :(
Re:The C Book (HTML Book on C) by telemachos on Saturday July 10, 2010 @11:44AM (#1503806)
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.
Re:The C Book (HTML Book on C) by MarkBook on Saturday July 10, 2010 @12:01PM (#1503844)
I was only kidding Shared joy is a double joy; shared sorrow is half a sorrow
Re:The C Book (HTML Book on C) by JadeNB on Saturday July 10, 2010 @05:50PM (#1504423)
> I say that a lot ("Good to know it's not just me."). I'll have to think a little bit more about why.

I say it a lot too, especially when talking about interfacing with external resources, and I don't think it's anything to do with enjoying others' misery. It's simply being happy to have it confirmed that the problem you're observing is (probably) someone else's fault, not your own; this carries the bad news that you (probably) can't fix it yourself, but the good news that you don't have to fix it yourself.

Re:The C Book (HTML Book on C) by wizzard19 on Saturday August 14, 2010 @02:41PM (#1603791)
Here's the official GNU C book: http://www.htu.tugraz.at/~past/ctut/ctut.pdf