Ahh filestreaming help(one question)
K hi there for my comp class we need to wright a program that randmly fills in a file then it check with a file that has a story in it and it keps doing this till it generates an exact copy of that file. Well i got evrything done beside i got problem every time i open for writing it truncates the file i am working on grrrr. So i tryed
Code:
"ofstream.outfile ("my.txt", ios::app);"
.
But that puts it at the end of the file so that does not work and i tryed putting the
Code:
"outfile.seekp(0);"
and now it is driving me crazy. I also tryed
Code:
"ofstream ("my.txt", ios::out);"
that did nothing. PLZ help me lol. And i know u can cope it over to second file but then it be SO much work lol. I was wondering if there is simpler way not because i am lazy but i made my whole program do this way and will take long time to fix. Thanks if u did not understand this at all my bad kind of in a rush. THANKS