Professional Documents
Culture Documents
1 C File Processing Download
1 C File Processing Download
The extern keyword is used to indicate that the variable can be accessed by another file. It's name is visible
globally.
2.
The statement
#include"filename.h"
3.
[A] fopen
[B] fclose
[C] fread
The fopen function need a filename. It opens a file and points either begining or end of the file.
here r stands for file access mode for reading a file only. The other modes are w, a, r+, w+, a+
4.
{
FILE *f=fopen(filename, "r");
fread(f);
if(????)
puts("End of file reached");
}
Which one of the following can replace the ???? in the code above to determine if the end of a file has been
reached?
[A] f==EOF
[B] feof(f)
[C] eof(f)
[D] f==NULL
In 'C' programming EOF(end of file) is used to read a file till the end.
If(f==EOF)
5.