/* ch1a.c James S. Plank */ /* This program demonstrates an error and how errno/perror are used. */ #include #include int main() { FILE *f; f = fopen("/home/jplank/noexist", "r"); if (f == NULL) { printf("f = null. errno = %d\n", errno); perror("/home/jplank/noexist"); } return 0; }