Re: << run time error
deepakvsoni@gmail.com wrote:
I get a abnormal program termination error and i suppose it doesn't
show any error code.
I've problem only with friend functions.
I doubt that the friend function is the problem. 'friend' only allows you to
access a class' internals from a normal (non-member) function.
//Display the matrix
std::ostream & operator<< (std::ostream &out, const CSparse &Sparse)
{
for(int i = 0; i < Sparse.m_nMaxRows; i++) {
Node *pRowLead = Sparse.m_pRowHead[i];
Is 'Sparse.m_pRowHead' null?
Other than that, some info on a minimal example. Such a minimal example
contains one
int main() {
...
return 0;
}
and the remaining code that is necessary to reproduce the problem.
Seriously, remove every single piece of code that is not necessary.
However, include all that is necessary. Dumping two functions that you
think cause the error without the necessary context just doesn't work.
Also, it doesn't really make me eager to help you.
Uli
--
With sufficient truth, Reff Jelf flies just fine. However, this is not
necessarily a good idea. It is hard to be sure where he is going to
land, and it could be dangerous sitting under him as he flies overhead.
(inconcisely paraphrasing RFC 1925)