Introcuded the "eof" variable for indicating the end of file. The p variable is