Tab Deliminated output file
Hi,
Does anyone know how to create a tab deliminated output file? My data is in a multidimensional array.
Here is my code, but it doesn't work:
Code:
void writeResultMatrix(void)
{
cout << "\nWriting result matrix to file .... ";
ofstream f_out;
f_out.open("myfile.txt", ios::out);
for (int r = 1; r < rows; r++) //for each row
{
//start new line
f_out << "\n";
for (int c = 1; c < columns; c++)
{
f_out << resultArray[c,r];
//tab
f_out << "\t";
}//for
}//outer for
f_out.close();
cout << "DONE\n";
}//void
Re: Tab Deliminated output file
instead of "\n" and "\t"
use
'\n' and '\t'
Re: Tab Deliminated output file