I have a function like so:
void my_func(unordered_map<std::string, std::string> arg){
//Create/open file object on first call and append to file on every call
//Stuff
}
and inside this function I wish to write to a file. How can I achieve this without having to create the file object in the caller and pass it in as a parameter? Each time the function is called I would like to append the latest write to the end of the file.