|
-
March 8th, 2011, 04:14 PM
#8
Re: C++ using fstream to calculate average and standard deviation
Once the failbit gets set on a stream, you need to clear it before
you can do anything else with the stream.
So, in your section, if the file can not be opened, the failbit gets set.
All attempts to open a file using that stream will fail.
Use the clear() member function to clear the flags for the stream.
Code:
cin >> fileget;
receive.clear();
receive.open(fileget);
I did not look at the rest of your code, but it is probably the same
problem.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|