How to write a multiline CSV in C++?

I am making a C++ QT application within which I will periodically get (configurable default will probably be 30 seconds) counters and would like to write these counters to a .csv file. Is there a better way for this than opening the file and appending the appropriate lines every period finally closing the file (other than writing to different files) and repeating this every period?

If there is no other way is the method above so resource heavy, that I should instead just write to multiple files ?

Source: c++

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.