You want to check the stream - which is outData in your case. That should look like:
if (outData.good ()) {
// ...
}
outData.close ();
The file variable is not declared anywhere and that is what the coimpiler is complaining about.
L7Sqr
Practically a Master Poster
657 posts since Feb 2011
Reputation Points: 201
Solved Threads: 124
You can open the stream in append mode. Something like
ofstream outData("Output1.csv", std::ios::out | std::ios::app);
The std::ios::app will set the insertion point to the end of the file to add to whatever is already there.
L7Sqr
Practically a Master Poster
657 posts since Feb 2011
Reputation Points: 201
Solved Threads: 124