please help me on this...:(
for example you have a:
string test;
void ExampleWindow::on_clicked(){
ofstream myfile;
string test;
myfile.open ("/home/ws14/Desktop/trunk/minisip/minisip/share/test.txt");
mydialfile << test;
mydialfile.close();
}
how can I just add or insert a value on the file(test.txt). not just overwrite the file(test.txt) when the function(on_clicked) is being called.
All I need is if the function(on_clicked) is being called. The value of test is must add/insert(not ovewrite it) on the file(test.txt).
please help me.... thank you!
valtikz
Junior Poster in Training
52 posts since Apr 2009
Reputation Points: 46
Solved Threads: 7
myfile.open(filename,ios::app);
ArkM
Postaholic
2,001 posts since Jul 2008
Reputation Points: 1,234
Solved Threads: 348
thanks for the help! I already know. But thanks to all hope to help me again.
valtikz
Junior Poster in Training
52 posts since Apr 2009
Reputation Points: 46
Solved Threads: 7
This is my next question: how to get a document from root?
because I have this code:
myfile.open ("/home/ws14/Desktop/test.txt");
But I need to change the path home/ws14 if I change user. Thanks!
valtikz
Junior Poster in Training
52 posts since Apr 2009
Reputation Points: 46
Solved Threads: 7