output unusal format for text file

Hello everyone,

Bit of a problem, I'm trying to output the data from my code into a particular format to a text file. The format is

y0 y1 y2 y3 y4 y5...yn
z0 0.01 0.2 1
z1 0.4 0 etc...
z2
z3
z4
z5
...
zn

Any pointers?

Thank you in advance!
Last edited on
You could use the ofstream header. when you create the ofstream object, you give it the filename, and when the file is opened you can use the ofstream object exactly like std::cout.
Topic archived. No new replies allowed.