Short answer type questions on Files.
1. What is a file?
A file is a collection of data that is available in permanent storage.
2. Write the syntax for file declaration.
syntax : FILE *filepointer;
Example : FILE *fp;
3. What are modes in file?
Mode tells about the types operations like read,write or append that can be performed on a file that is being opened.
4. Write the syntax to open a file.
syntax : filepointer=fopen(FILENAME, MODE);
Example : fp=fopen(“in.dat”,r);
5. What is the significance of fclose() function?
This function closes a file that has been opened for an operation. Syntax:
fclose(filepointer);
Example : fclose(fp);
Thanks
Mukesh Rajput
Post A Comment:
0 comments: