June 23, 2019
Question 1
The value of EOF is _____
-1
2
1
10
Good Job!
Oops!
Currently there is no PrepInsta Explanation. Did you know?
You can also submit your own version of explanations under user explanation section and also view other submitted explanations by other users.
Please login to submit your explanation
You can check your performance of this question after Login/Signup
Start
Question 2
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 structure and fp is a pointer to the structure of FILE type
FILE is a stream
FILE is a buffered stream
typedef struct { int level; /* fill/empty level of buffer */ unsigned flags; /* File status flags */ char fd; /* File descriptor */ unsigned char hold; /* Ungetc char if no buffer */ int bsize; /* Buffer size */ unsigned char *buffer; /* Data transfer buffer */ unsigned char *curp; /* Current active pointer */ unsigned istemp; /* Temporary file indicator */ short token; /* Used for validity checking */ }FILE;
Question 3
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 poniter & the second argument is the mode
None of the mentioned
a) A character string containing the name of the file & the second argument is the mode
Question 4
Nothing
EOF
NULL
Depends on compiler
depends on the compiler
c) NULL
null
Question 5
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
Explanation: The rewind function sets the file position indicator for the stream pointed to by stream to the beginning of the file.
Question 6
int type
char * type
struct type
Explanation: 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.
structure obviously :)
Question 7
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
D
Explanation: It is a type name defined in stdio.h
Question 8
End of files is reached
When getc() fails to read a character
Both of the above —
None of the above
Question 9
fputs() with FILE stream as stdout.
fprintf() with FILE stream as stdout.
fwrite() with FILE stream as stdout.
All of the above three – a, b and c.
In “stdio.h”, there’s no other equivalent function of printf()
Question 10
True
False
Depends on the standard
Undefined behaviour
Answer: b
true
a) True
Please login to report