if ( fgets( line, sizeof(line), stdin ) == (char*) 0 )...
I don\'t understand what this line does,anyone knows?
It means a null pointer to char. It would be the same if you replace the (char*)0 with NULL. In this particular case it is checking if there is nothing more to read from the stdin. I think is just a way to be cryptic and showing some spectacular and beautiful features. If you replace it with a NULL you gain in readability without changing the semantic.