• Advertisement
Sign in to follow this  

File io help

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

ifstream fin;
fin.open(settings);
fin >> entry.left >> entry.right >> entry.top >> entry.bottom;
fin >> text.left >> text.right >> text.top >> text.bottom;
fin >> drag.left >> drag.right >> drag.top >> drag.bottom;
fin.close();
		
fin.open("ConsolCommands.txt");
int a = 0;
fin >> a;
fin.close();


The first part works fine but then I open ConsolCommands.txt and try to input the first int a always always stays equal to zero. Any help would be great thanks!

Share this post


Link to post
Share on other sites
Advertisement
Try adding fin.clear() after the first fin.close() to clear a possible EOF flag.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement