C Programming Problem
rae98
rae98 at wash08.UUCP
Thu Jan 5 06:10:04 AEST 1989
In article <32229 at auc.UUCP> tab at auc.UUCP (0-Terrence Brannon ) writes:
> int i, q, r, s, t, u, v;
> fscanf(fp, "%s %d %d %d %d %d %d", a, q, r, s, t, u, v);
>
>Any ideas why valid integers from a file can't be read in as integers but
>only can be read in a char strings?
>
>...!gatech!auc!tab
Yes. You'll probably get a hundred responses, but scanf requires
pointers for values, so the line should read:
fscanf(fp, "%s %d %d %d %d %d %d", a, &q, &r, &s, &t, &u, &v);
This should take care of your problem.
--
-------------------------------------------------------
UUNET: uunet!wash08!rae98 should work.
BITNET: I don't know...can you tell me?
UUCP: rae98 at wash08.UUCP does this work?
More information about the Comp.lang.c
mailing list