Can the values of `stdin`,` stdout` and `stderr` be considered constant?
From the Ubuntu man page stdin(3)
:
extern FILE *stdout;
From the mingw64 file stdio.h
:
#define stdout (&__iob_func()[1])
Both assume that the value stdout
(pointer) cannot be considered constant.
Can I still rely on something like this:
FILE * stream;
// early after startup
stream = stdout;
// much later, far down the stack, in a different function
fprintf(stream, "%s", "fprintf(stream, \"");
+3
source to share