• Advertisement

Archived

This topic is now archived and is closed to further replies.

OT: fscanf

This topic is 5509 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

fscanf( stream2, "%24c", max_elev); The above instruction reads 24 chars into max_elev. How can i specify a variable number of chars to be read ? Something like int numberofchars=24; fscanf(........ ?????
www.web-discovery.net

Share this post


Link to post
Share on other sites
Advertisement
Try the following:

int size = 24;
char sz[256];
sprintf(sz, "%%dc", size);
fscanf(stream2, sz, max_elev);

That might work, tho I can''t besure.

Share this post


Link to post
Share on other sites

  • Advertisement