>
I find this highly surprising, since the code isn't remotely
compilable.
>
If one hallucinates that fp is a FILE*, and that the code
appears within, say, main, and that the fopen call repairs
to
>
fp = fopen( "r", "abc.txt" );
>
to get that problem report, then I'd expect it to be because
there's no file called `r` to open.
[Ignoring the trolling of the OP...]
7.19.5.3p3 states:
If the string is one of the following, the file is open in the
indicated mode. Otherwise, the behavior is undefined.
It is perfectly acceptable that the UB outputs "file not opening"
as a result of this, once the obvious syntax errors are "fixed",
whether or not a file named "r" exists. :-)
Comment