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

SAP Web Service from .NET via WCF -

Optimized Line drawing in QT -

datetime - str to time in python -