-
Why core dump??
I cant figure out why I continue to get a core dump with this function. I'm trying to print out the numbers 3, 5, 7, 9, 11, 13
_num, field_size, and num_per_line are all equal to 6 when I call the function
Code:
void Vect::tellsome( ostream & out, int field_size, int num_per_line)
{
for(int i = 0; i < _num; ++i)
{
if((i % num_per_line) == 0)
{
out << endl;
}
out << setw(field_size) << _data[i];
}
}
-
> I cant figure out why I continue to get a core dump with this function
Probably because the problem is really somewhere else, and here is just where you get to notice that there is a problem.
We really need the whole program (or a complete sub-program which also crashes) to comment in any meaningful way.
Except to say that you need to check every pointer, and every new call in your code.