Vidyalelo
C Programming · Q33

File Input Output

Programming · C Programming · question 33

Q33

What are the two predefined FILE pointers in C?

A.
console and error
B.
stdout and stdio
C.
stdout and stderr
Answer
D.
stdio and stderr
E.
console and stdio.

Answer: Option C

Solution

Answer: Option C
Solution:

Besides the file pointers which we explicitly open by calling fopen, there are also three predefined streams. stdin is a constant file pointer corresponding to standard input, and stdout is a constant file pointer corresponding to standard output. Both of these can be used anywhere when a file pointer is called for; for example, getchar() is the same as getc(stdin) and putchar(c) is the same as putc(c, stdout). The third predefined stream is stderr. Like stdout, stderr is typically connected to the screen by default. The difference is that stderr is not redirected when the standard output is redirected.