By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,479 Members | 1,749 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,479 IT Pros & Developers. It's quick & easy.

how many arguments in fscanf of gcc?

P: n/a
fscanf(fp,"\n", &intensity);

will generate the following warning:

warning: too many arguments for format

how to fix it ? Thanks a lot.

Jul 5 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a

asdf 写道:
fscanf(fp,"\n", &intensity);

will generate the following warning:

warning: too many arguments for format

how to fix it ? Thanks a lot.
Try this:

int intensity;

fscanf(fp, "%d", &intensity);

Jul 5 '06 #2

P: n/a
asdf wrote:
fscanf(fp,"\n", &intensity);

will generate the following warning:

warning: too many arguments for format

how to fix it ?
Well, your fscanf call has one argument after the format string, but the
format string itself says that there are no more arguments. You should look
up in your documentation how fsanf works. Your format string makes no
sense.
Jul 5 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.