When opening a file with fopen, what happens if the file does not exist and the mode is set to 'r'?

  • It appends data to the existing file.
  • It creates a new file.
  • It overwrites the file's content.
  • It returns a NULL pointer.
When opening a file with fopen in read mode ('r') and the file doesn't exist, it returns a NULL pointer, indicating that the file was not successfully opened.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *