Hey guys, I'm trying to debug a big project i have and I think I've encountered the first problem. right now the problem lies with getting list values from textfiles by going through them more than once and when i output the values, I get nothing.
A textfile has 3 columns that represent a matrix
example:
row column value
1 1 1
1 2 2
2 1 1
2 2 2
My code looks long but its really the same thing getting repeated over and over again.
This is the code portion I'm trying to fix:
//Stores row, column, and value int a[3]
stringstream str(temp);
while(str >> a[i])
{
i++;
}
r = atoi(a[0].c_str());
c = atoi(a[1].c_str());
val = atof(a[2].c_str());
i=0;
//Supposed to store val into list if r is equal to x
if(r==x)
{
m_row = new row(val, m_row);
}
}
//increments x for next iteration
x++;
}
RPTR = m_row; // sets RPTR equal to m_row linked list