The C spec mandates all C programs have 3 streams open and available to them: stdout
, stdin
, stderr
.
The users can use these streams as they see fit, e.g.:
fprintf(stdout, "lol");
fputs("oops", stderr);
fgets(buffer, 20, stdin);
Some functions in the C standard library implicitly use these, e.g.:
printf("lol"); /* implicitly uses stdout */
puts("rofl"); /* implicitly uses stdout */
int c = getchar(buffer); /* implicitly uses stdin */
- Do any functions in the C standard library implicitly use
stderr
? - Do any functions in common implementations of the C standard library (eg. GNU's glibc on Linux) implicitly use
stderr
?