-
perror
Code:
if( (fp = fopen(name_ptr, mode_ptr)) == NULL){
perror(name_ptr);
exit(1);
}
For some reason the fopen failed, but perror displayed the message "no error". Does anyone know why, after all fopen returns NULL when there is an error so perror should report it.
It only did this the once and I was just wondering why.
-
> perror(name_ptr);
Since perror prints out this string, then the text for the error message - I can only assume that if you saw no filename printed, then that was the cause of the problem.
Namely, trying to open an un-named file.
-
That makes sense, thanks salem