mbanghart
July 30th, 2008, 11:43 AM
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:
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
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:
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