C++: Write to an existing file? -


this question has answer here:

in c++, need write existing file , keep previous content there.

this have done:

std::ofstream logging;  logging.open(filename);  logging << "hello\n";  logging.close(); 

but previous text overwritten (gone). did wrong?

thanks in advance.

logging.open(filename, std::ios_base::app);  

Comments

Popular posts from this blog

android - Spacing between the stars of a rating bar? -

aspxgridview - Devexpress grid - header filter does not work if column is initially hidden -

c# - How to execute a particular part of code asynchronously in a class -