Если это возможно, любая помощь будет большой
Я уже пробовал этот код,
float deposit (float balance)
{
double amount;
system("cls");
cout<<"Enter the amount you wish to deposit"<<endl;
cin>>amount;
ofstream newBalance;
newBalance.open ("deposit.txt", fstream::app);
newBalance<<amount;
newBalance.close();
balance = balance + amount;
writeBalance(balance);
return balance;
}
//This is a function to allow the user to increase their balance
Вы можете поставить
fstream::out | fstream::app
вместо просто fstream::app
Вы можете посмотреть:
http://www.cplusplus.com/reference/fstream/fstream/open/
Чтобы добавить новую строку, выполните:
newBalance<<amount<<"\n";