Portability help

Maarten Litmaath maart at cs.vu.nl
Tue Feb 14 05:46:36 AEST 1989


davek at lakesys.UUCP (Dave Kraft) writes:
\...
\	char a, b, c, d, e;
\...
\   	printf("\n>>%s<<", &a);
                           ^^
You're telling printf() to expect a string, i.e. the address of the first of a
sequence of bytes, TERMINATED BY A '\0' BYTE; instead you supply printf() with
the address of 1 char. Use `%c' and delete the `&'.

\...
\	if(x == EOF)
\		printf("\nInput stream empty.");
\	else;
            ^
Probably you didn't intend that.
-- 
 "I love it                            |Maarten Litmaath @ VU Amsterdam:
          when a plan comes together." |maart at cs.vu.nl, mcvax!botter!maart



More information about the Comp.lang.c mailing list