You are tasked with developing a program that logs error messages to a file. Which file handling functions would be most appropriate to use?

  • fopen() and fprintf()
  • fread() and fwrite()
  • fclose() and fseek()
  • fgets() and fputs()
To log error messages to a file in C, you would typically use fopen() to open the file in write mode and fprintf() to write the error messages to the file. The other options involve reading or manipulating data, not writing to a file.
Add your answer
Loading...

Leave a comment

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