c - fopen returns null and perror prints invalid argument -
I have created a file called "test" but I am unable to use it FOPN. Here's the code -
Add # & lt; Stdio.h & gt; Int main () {FILE * fp; Fp = fopen ("test.txt", "r"); If (fp == NULL) {perror ("Error:"); } Fclose (fpose); Return 0; }
When I run the code above, I get the following output:
Error: invalid argument
What could be the reason? When does the Madden "invalid logic" error message?
Take a look at this:
EINVAL Fopen (), The method provided for fdopen (), or FreeOpen () was invalid.
Perhaps test.txt
is not readable.
Comments
Post a Comment