Reputation: 15
I have the following code
struct FILE *in, *out;
if (argc == 1) {
/* No files were supplied so assume parsing from the stdin and printing to the stdout */
in = stdin;
out = stdout;
}
However when compiling with gcc using flags -ansi -Wall -Wextra -Werror
the following error occurs: assignment from incompatible pointer type
.
I looked up on the GNU C Library Reference Manual for the type of stdin
and on page 227 (251 on Adobe Reader) the type in indeed FILE *
so I don't know what is wrong.
Upvotes: 1
Views: 1147