ios:app doesn't work.
Hi! I've made a simple calculator which saves history of calculations in history.txt. I wanted to use ios:app to not overwrite data. The problem is ios:app is detected as bug. Thanks! Code: #include <iostream> #include <windows.h> #include <conio.h> #include <ostream> #include <fstream> using namespace std; int main() { int operation, x, y, result; string answer; restart: cout << "\nChoose operation" << endl; cout << "[1] Addition\n[2] Subtraction\n[3] Multiplication\n[4] Division\n"<<endl; cin>>operation; cout << "Input first number: " <<endl; if (!(cin>>x)){ cerr << "It's not number!"; exit(0); } cout << "Input second number: " <<endl; if (!(cin>>y)){ cerr << "It's not number!"; exit(0); } switch(operation) { case 1: result=x+y; break; case 2: result=x-y; break; case 3: result=x*y; break; case 4: result=x/y; break; default: cout << "There is no such operation" <<endl; exit(0); } /* Save data in history.txt */ fstream file; file.open("history.txt" , ios::out | ios:app); switch(operation) { case 1: file<<"x+y="<<result<<endl; break; case 2: file<<"x-y="<<result<<endl; break; case 3: file<<"x*y="<<result<<endl; break; case 4: file<<"x/y="<<result<<endl; break; } file.close(); cout << "Result is " << result << "\n\n" <<endl; Sleep(1000); cout << "Do you want to leave? y/n" <<endl; cin >> answer; if(answer=="y"){ return 0; } if (answer=="n"){ goto restart; } cout << "Click any button to leave." <<endl; getch(); return 0; }