Click here to Skip to main content
15,925,782 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Struct issue Pin
John M. Drescher2-Apr-04 4:28
John M. Drescher2-Apr-04 4:28 
GeneralRe: Struct issue Pin
Alexander M.,2-Apr-04 6:01
Alexander M.,2-Apr-04 6:01 
GeneralRe: Struct issue Pin
John M. Drescher2-Apr-04 7:12
John M. Drescher2-Apr-04 7:12 
GeneralRe: Struct issue Pin
Alexander M.,2-Apr-04 7:36
Alexander M.,2-Apr-04 7:36 
GeneralRe: Struct issue Pin
Maxwell Chen2-Apr-04 7:49
Maxwell Chen2-Apr-04 7:49 
GeneralRe: Struct issue Pin
Anonymous2-Apr-04 11:15
Anonymous2-Apr-04 11:15 
GeneralWrite a matrix to a txt file Pin
dairiseky2-Apr-04 3:15
dairiseky2-Apr-04 3:15 
GeneralRe: Write a matrix to a txt file Pin
David Crow2-Apr-04 4:01
David Crow2-Apr-04 4:01 
for (i = 0; i < nx; i++)
{
    for (j = 0; j < ny; j++)
    {
        if (cellV[i][j] > 0)
        {
            cellsV[i][j] = cellV[i][j] * cellV[i][j];
            if (cellsV[i][j] > noise_border)
            {
                ofstream BuiltMap;
                BuiltMap.open("C:\\My Files\\BuiltMap\\BuiltMap.txt", ios::in);
                while (! BuiltMap.eof())
                {
                    BuiltMap << "\n" << " " << cellsV[i][j];
                }
            }
            else
                cellsV[i][j] = NULL;
        }
    }
}
Aside from the fact that the opening/closing of the file should be done outside of the loops, I'm not quite sure what you are doing here. You've got an ofstream object that is opening a file for input (i.e., reading), yet you are usign the << operator to write to it. Is this intentional?


"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)


GeneralRe: Write a matrix to a txt file Pin
dairiseky2-Apr-04 4:26
dairiseky2-Apr-04 4:26 
GeneralRe: Write a matrix to a txt file Pin
David Crow2-Apr-04 4:56
David Crow2-Apr-04 4:56 
GeneralCTreeCtrl sort parameters getting corrupted Pin
roybrew2-Apr-04 2:17
roybrew2-Apr-04 2:17 
GeneralLoadLibrary Error Pin
JeabJB2-Apr-04 2:07
JeabJB2-Apr-04 2:07 
GeneralRe: LoadLibrary Error Pin
Alexander M.,2-Apr-04 2:13
Alexander M.,2-Apr-04 2:13 
GeneralRe: LoadLibrary Error Pin
JeabJB2-Apr-04 2:29
JeabJB2-Apr-04 2:29 
GeneralRe: LoadLibrary Error Pin
David Crow2-Apr-04 2:56
David Crow2-Apr-04 2:56 
GeneralRe: LoadLibrary Error Pin
JeabJB2-Apr-04 3:10
JeabJB2-Apr-04 3:10 
GeneralRe: LoadLibrary Error Pin
David Crow2-Apr-04 3:23
David Crow2-Apr-04 3:23 
GeneralRe: LoadLibrary Error Pin
JeabJB2-Apr-04 3:34
JeabJB2-Apr-04 3:34 
GeneralRe: LoadLibrary Error Pin
David Crow2-Apr-04 3:38
David Crow2-Apr-04 3:38 
GeneralRe: LoadLibrary Error Pin
JeabJB2-Apr-04 3:49
JeabJB2-Apr-04 3:49 
GeneralRe: LoadLibrary Error Pin
David Crow2-Apr-04 4:05
David Crow2-Apr-04 4:05 
Generaliterator Pin
Jerome Conus2-Apr-04 1:53
Jerome Conus2-Apr-04 1:53 
GeneralRe: iterator Pin
Jonas Larsson2-Apr-04 2:12
Jonas Larsson2-Apr-04 2:12 
GeneralRe: iterator Pin
Maxwell Chen2-Apr-04 2:14
Maxwell Chen2-Apr-04 2:14 
GeneralRe: iterator Pin
monrobot132-Apr-04 6:30
monrobot132-Apr-04 6:30 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.