opens the file for reading and returns a pointer to the first file record unless an error has occured, when it returns a null pointer

f_ptr = fopen("bookinventory", "r");

if(f_ptr == NULL)

printf("Can not open the file");