:)PHP Code:ofstream fout("file.txt", ios::app); //for append
fout<<"some text";
fout.close();
Printable View
:)PHP Code:ofstream fout("file.txt", ios::app); //for append
fout<<"some text";
fout.close();
Thank yew :)
I think I put the code in a wrong spot... It just like a LOOP in VB. I get like 10 copies of the text every time I click the button, and yes it appends... But where do you put the:
Code:ofstream OP("test.txt",ios::app);
...
Try:
Code:
ofstream OP("test.txt", ios::app);
for(int i=0; i<10; i++)
OP << "My Text"
OP.close();