Joe said:
Flash Gordon wrote:
Personal preference. I know they are not needed, however I prefer to use
them. To me it's much like the age old void foo() { and void voo()\n{
complaint - use whatever you're comfortable with.
I agree that it is a matter of style. When commenting on code I have a
habit on commenting on all aspects, including those of style. I prefer
"return 0;" to "return(0);" because it is fewer characters and I get a
far more helpful error for "retrun 0;" than I do for "retrun(0);".
Completeness is never wrong. You should always use NULL instead of a
hard-coded value. Again, personal preference I suppose.
I was commenting on your comment, not the code. I use NULL myself, but
it is important to know that for all implementation 0 is also valid, not
because you should use it but because so many other people *do* use it.
No, I did not. Again, it was a late-night reply and not very well
thought out it would seem
We all make that mistake on occasion
Due to the lack of a /n or flushing stdout there is even less guarantee
than normal that it will be output before the next function call, line
buffering being fairly normal (and allowed by the standard) on stdout.
Yes, I agree however the OP was doing the same thing therefore I kept it
along the same path as him, the only difference is my added printf
statement.
Around here, it would be advisable to not post non-standard C, at least
without appropriate disclaimers and pointing people else where for
discussing it, or you *will* get people pulling you up on it.
As others have suggested in the past, if one *really* wants to do
something like that then the portable solution is a loop reading
characters waiting for a newline, for anything else a non-standard
solution is required and such solutions do not belong on this group.