if ( fgets( line, sizeof(line), stdin ) == (char*) 0 )...
I don\'t understand what this line does,anyone knows?
(char*)0 creates the "null" pointer. So you are seeing if the value of fgets is null.
The documentation for fgets states that it returns null when there is an error or you have reached end of file.
The full statement appears to be checking if you are at the end of the file, and if so breaking out (though that's a guess).