How can i save the output of c++ program in cvs file?
I have to this type of data
I have a loop in that i have data of three types and i want to asve it on
cvs file format. Saved data should be some thing like this
id name place gender
1 rita abc female
2 Ali def male
based on loop iteration, data will be iterated and saved in cvs file format.
How can i do that in c++?
Kindly let me know .
Just output a comma as the separator between each value. At the end of each line, instead of a comma, use an ordinary newline or endl.
Well, you opened the file in append mode, with the
That's why it appends the new data to the end of the existing file.