ofstream
From: Jon Cosby (jcosby_at_nospam.net)
Date: 11/28/04
- Next message: Jonathan Mcdougall: "Re: ofstream"
- Previous message: Alwyn: "Re: Broken copy constructor."
- Next in thread: Jonathan Mcdougall: "Re: ofstream"
- Reply: Jonathan Mcdougall: "Re: ofstream"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sun, 28 Nov 2004 19:05:37 GMT
I'm getting different results for cout and the ofstream. In the clip below,
only the last 14 hits out of 1023 are written to the file. All the results
are printed to the screen. What's the reason for this?
Jon
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
#include <fstream.h>
ofstream results("results.txt");
char** mysq = new char*[n];
for (i = minp; i <= maxp; i++)
{
for (int p = k; p < n; p++)
mysq[p][k] = mysq[k][p] = strlist[i][p];
if (k == n - 1)
{
hits++;
results << "\n" << hits << "\n";
cout << "\n" << hits << "\n";
for (int r = 0; r < n; r++)
{
for (int c = 0; c < n; c++)
{
results << mysq[r][c];
cout << mysq[r][c];
}
}
}
else
// Iterate....
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- Next message: Jonathan Mcdougall: "Re: ofstream"
- Previous message: Alwyn: "Re: Broken copy constructor."
- Next in thread: Jonathan Mcdougall: "Re: ofstream"
- Reply: Jonathan Mcdougall: "Re: ofstream"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]