• Advertisement

Archived

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

easy fscanf question

This topic is 5468 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

I would like to know why this doesn''t work: fscanf(file,"%lf %lf %lf", &vertex[z].x, &vertex[z].z,&vertex[z].y); for the following data in a file: 0.5 0.49999997019767761 0.0

Share this post


Link to post
Share on other sites
Advertisement
You would have to write all your values with the same precision, otherwise it won''t read them at all. I don''t know why it is so, but when I write %f %f %f it assumes 6 precision value for each %f.

Just try to make them of the same length, e.g:
0.5 = 0.50000000000000000
0.49999997019767761
0.0 = 0.00000000000000000

Although that would be a huge waste of memory, I''d recommend that you choose a precision of the values.

Good luck.

" Do we need us? "


Ionware Productions - Games and Game Tools Development

Share this post


Link to post
Share on other sites

  • Advertisement