"aamir" <[EMAIL PROTECTED]> writes: > Anyways, after using a debugger it showed me some memory leaks but I am > unable to understand this one. Debugger message is
This isn't a leak. It's a use of uninitialized value. > ==11474== Use of uninitialised value of size 8 > ==11474== at 0x804F03B: FindTree(AnswerPoint, AvlNode*) (avltree.cc:65) > ==11474== by 0x8049BED: main (prog2.cc:652) > > And the part of avltree.cc looks like > > ======================================================= > Position_tree > FindTree( AnswerPoint X, AvlTree T ) > { > if( T == NULL ) > { > return NULL; > } > if( X.distance < T->Element.distance ) // ==>debugger is > talking about this line So either X.distance or T->Element.distance has not been initialized. > The line about which debugger is talking is shown in the above code. > But I have made it pretty sure that in prog.cc at line 652 , the > distance value is not unitialized. Which 'distance' value have you made sure is initialized? There are 2 values that are being compared. Cheers, P.S. It looks as if AnserPoint might be a struct with more than one 'double' member. If so, passing such structs by value is very inefficient, and you should probably pass them by reference instead. -- In order to understand recursion you must first understand recursion. Remove /-nsp/ for email. _______________________________________________ help-gplusplus mailing list help-gplusplus@gnu.org http://lists.gnu.org/mailman/listinfo/help-gplusplus