K
Keith Thompson
Franken Sense said:I was commenting-out a print statement, and I used fortran by mistake:
while((len = getline(fp, text, text_length)) > 0)
{
++ lineNumber;
!printf("%lu, %s", lineNumber, text);
root_node = add_to_tree( root_node, text);
}
Not only did this compile, it behaved, that is, it printed as if the !
didn't exist. How is this not an error?
printf() returns an int result (which is often ignored). "!" is the
unary logical not operator; it yields 1 if its argument is zero, 0 if
its argument is non-zero. printf returned some positive value
(assuming it succeeded), "!" yielded the value 0, and that value was
then discarded.