I am currently creating a banking application with many features. One of the features is that it has to output transactions to a file.
I am trying to figure out how to output variables and strings using the 1 write function.
Example, let's say my text file I am outputting to is called output.txt.
I could use:
output <<"test text" <<variable.getNumber() <<"will output an integer number";
...which is fine, but it overwrites the text in the file each time the function is called, so I want to use the write function, which apparently adds to the text file instead of overwriting.
The problem is, I cant figure out how to provide the write function with multiple strings/variables as it only lets you declare 2 arguments, char and streamlength (which will also be a problem doing it this way).