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

Mukesh Rajput

Mukesh Rajput

I am a Computer Engineer, a small amount of the programming tips as it’s my hobby, I love to travel and meet people so little about travel, a fashion lover and love to eat food, I am investing a good time to keep the body fit so little about fitness also..

Post A Comment:

0 comments: