Hacker News new | ask | show | jobs
by michaelcampbell 58 days ago
Looks interesting and fun, but in no instance of any C compiler I've come across is the "classic example" of "hello, world" using `fprintf(stderr, ...)`

To each their own I guess.

3 comments

Give io buffering an inch and it will take a mile
I give you `if (0 > fdprintf (STDERR_FILENO, ...))` instead.

But on a serious matter, it's a good thing to tell a beginner that diagnostics belong on stderr, not stdout.

The real classic is from The C Programming Language (where I saw it) and is:

main( ) { printf("hello, world"); }