C File handling MCQ
Q1. Which of the following true about FILE *fp
- FILE is a keyword in C for representing files and fp is a variable of FILE type.
- FILE is a stream
- FILE is a buffered stream
- FILE is a structure and fp is a pointer to the structure of FILE type
Answer:- (D).
Explanations :fp is a pointer of FILE type and FILE is a structure that store following information about opened file.
Explanations :fp is a pointer of FILE type and FILE is a structure that store following information about opened file.
- a
- w
- f
- t
Answer:- (B).
Explanations :none.
Explanations :none.
- A character string containing the name of the file & the second argument is the mode
- A character string containing the name of the user & the second argument is the mode
- A character string containing file pointer & the second argument is the mode
- None of the mentioned
Answer:- (A).
Explanations :none.
Explanations :none.
- int type
- char * type
- struct type
- None of the mentioned
Answer:- (C).
Explanations : It is what is typically termed an opaque data type, meaning it's typically declared as a simple structure, and then internally in the OS libraries the FILE pointer is cast to the actual date-type of the data-structure that the OS will use access data from a file. A lot of these details are system-specific though,so depending on the OS, the definition may differ.
Explanations : It is what is typically termed an opaque data type, meaning it's typically declared as a simple structure, and then internally in the OS libraries the FILE pointer is cast to the actual date-type of the data-structure that the OS will use access data from a file. A lot of these details are system-specific though,so depending on the OS, the definition may differ.
- rewind() doesn't work for empty files
- rewind() may fail for large files
- In rewind, there is no way to check if the operations completed successfully
- All of the above
Answer:- (C).
Explanations :The rewind function sets the file position indicator for the stream pointed to by stream to the beginning of the file.
Explanations :The rewind function sets the file position indicator for the stream pointed to by stream to the beginning of the file.
- A structure tag declared in stdio.h
- One of the basic datatypes in c
- Pointer to the structure defined in stdio.h
- It is a type name defined in stdio.h
Answer:- (D).
Explanations :It is a type name defined in stdio.h
Explanations :It is a type name defined in stdio.h
- "b"
- "B"
- binay"
- "01"
Answer:- (A).
Explanations :none.
Explanations :none.
- Same
- Both connected to screen always.
- Both connected to screen by default.
- stdout is line buffered but stderr is unbuffered.
Answer:- (C).
Explanations :none
Explanations :none
- .txt
- .bin
- .c
- None of the above
Answer:- (D).
Explanations :none
Explanations :none
- Standard input
- Standard output
- Standard error
- All of the above
Answer:- (D).
Explanations :none
Explanations :none
Copyright © 2022 Shineskill Software Pvt. Ltd., All rights reserved.