File Handling in c language is used to open, read, write, search or close file. It is used for permanent storage.
---------------------------------------------------------------------------------------------------------------------------------
Next Page Home Last Page
---------------------------------------------------------------------------------------------------------------------------------
1.
More Imp Topics:
---------------------------------------------------------------------------------------------------------------------------------
Next Page Home Last Page
---------------------------------------------------------------------------------------------------------------------------------
1.
The first and second arguments of fopen are?
A. A character string containing the name of the file & the second argument is the mode.
B. A character string containing the name of the user & the second argument is the mode.
C. A character string containing file poniter & the second argument is the mode.
D. None of the mentioned of the mentioned.
Answer: A
---------------------------------------------------------------------------------------------------------------------------------
2.
Which of the following statements about stdout and stderr are true?
A. Same
B. Both connected to screen always.
C. Both connected to screen by default.
D. stdout is line buffered but stderr is unbuffered.
Answer: C
--------------------------------------------------------------------------------------------------------------------------------
3.
FILE reserved word is?
A. A structure tag declared in stdio.h
B. One of the basic datatypes in c
C. Pointer to the structure defined in stdio.h
D. It is a type name defined in stdio.h
Answer: D
--------------------------------------------------------------------------------------------------------
4.
What does the following segment of code do?
fprintf(fp, “Copying!”);
A. It writes “Copying!” into the file pointed by fp
B. It reads “Copying!” from the file and prints on display
C. It writes as well as reads “Copying!” to and from the file and prints it
D. None of the mentioned
Answer: A
-------------------------------------------------------------------------------------------------------
5.
Which of the following mode argument is used to truncate?
A. a
B. f
C. w
D. t
Answer: C
-------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------
More Imp Topics: