Hello,in my program i have to write some points on a txt file,so what i'm doing is:
1 2 3 4 5 6 7 8 9
ofstream fileoutput("file.txt",std::ios::out | std::ios::app);
//find points
findMean(points,fileoutput);
void findMean(vector<int>points,ofstream &fileoutput){
//find mean of points and then..
fileoutput<<mean<<endl;
fileoutput.close();
}
the code compile and works,i mean if i do a cout of mean before putting in file values are correct,but when i close the program file.txt is empty.what can be the problem?
ok i added an if(!fileoutput) with a cout and it prints,so cannot find the file.what can i do?
if i do: