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

Popular posts from this blog

apache - 504 Gateway Time-out The server didn't respond in time. How to fix it? -

c# - .net WebSocket: CloseOutputAsync vs CloseAsync -

c++ - How to properly scale qgroupbox title with stylesheet for high resolution display? -