Program received signal SIGSEGV, Segmentation fault.
0x000000000040147d in Atree::insert (this=0x7fffffffde60, data=100, taller=false, root=0x605260) at avl.cpp:90
90 cout<<m_root->m_left->m_data << endl;
(gdb) where
#0 0x000000000040147d in Atree::insert (this=0x7fffffffde60, data=100, taller=false, root=0x605260) at avl.cpp:90
#1 0x0000000000401259 in Atree::add (this=0x7fffffffde60, data=@0x7fffffffde8c) at avl.cpp:31
#2 0x0000000000400eba in main (argc=2, argv=0x7fffffffe208) at avlmain.cpp:50
the cout is for testing purpose that it inserted the <100> into the left pointer of m_root..
what is getting me is the recursion. Thanks in advance
any help would be appreciated ! :)
The "this" pointer in the debug output looks a bit suspicious to me. Did you call the insert(...) function with something like p->insert(100, false, ???)
where p is a dangling pointer?