|
-
July 30th, 2008, 11:43 AM
#1
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
-
July 30th, 2008, 12:22 PM
#2
Re: Tab Deliminated output file
instead of "\n" and "\t"
use
'\n' and '\t'
Wakeup in the morning and kick the day in the teeth!! Or something like that.
"i don't want to write leak free code or most efficient code, like others traditional (so called expert) coders do."
-
July 30th, 2008, 12:53 PM
#3
Re: Tab Deliminated output file
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|