When a system call or library function fails, it sets a global variable called errno to a number representing the error. The perror function prints a message you give it, followed by a colon and the system's description of that error number. The strerror function returns the error description as a string, so you can use it in your own messages. In the example, fopen tries to open a file that does not exist, so it returns NULL and sets errno to 2, meaning 'No such file or directory'. Then perror prints 'File open error: No such file or directory'. This helps you understand what went wrong quickly. strerror can be used if you want to build your own error messages instead of printing directly.