How can I delete the old entries from the .txt file and replace them with the new ones?
Like : I have a text file that has "123" in it, when I try to change the txt file it just adds the new text, I add "abc" to it and it comes out "123abc", but I want it to just be "abc" in it.
#include <iostream>
#include <fstream>
using namespace std;
#include <stdio.h>
int main () {
string text;
fstream fails;
fails.open("Teksts.txt",ios::out | ios::app);
cout << "Enter word you want to replace the old entry with: ";
cin >> text;
fails << text;
fails.close();
return 0;
std::cin.get();
}