I have just started learning A* and I did successfully to implement with std::vector in C++. However, when I am integrating my Binary Heap implementation, I have problems with POINTER etc and I have spent much time to debug but still could not get a solution of it. May I ask for a little help?
PROBLEM: Whenever I want to access the parent pointer it will give me run time error. The same algorithm (A*) runs smoothly when I am using std::vector.
Inside my CellNode.h
void Print(){
cout << "Cell Node id : " << m_id << " ("<<m_xcoord << " , " << m_zcoord << ")" <<" F = "<< getF()
<< " G = " << getG() << " H = " << getH();
if ( parent != 0){
cout << "Cell Node Parent id " << parent->m_id << endl;
}
else{
cout << endl;
}
}
It enters the if condition but it doesn't have any parent reference. I am pretty much confused with this.
In the implementation I am using Visual Studio 2010 and OpenGL as the graphics rendering. Any kind of help is much appreciated..
Thanks.