不要介意我是一個白癡如何創建一個節點類的指針父節點,我可以使空
我現在的節點類
class node
{
public:
int xCoord; // current position
int yCoord;
int gCost; //Cost to travel to node
int hCost;
int parentX; // parent coordinates
int parentY;
node* parentNode;
node(int x, int y, int g , int h, int pX, int pY, node* parent)
{xCoord=x; yCoord = y; gCost = g; hCost = h; parentX = pX; parentY = pY; parentNode = parent;}
int getxCoord() const {return xCoord;}
int getyCoord() const {return yCoord;}
int getgCost() const {return gCost;}
int getfCost() const {return hCost;}
int getparentX() const {return parentX;}
int getparentY() const {return parentY;}
我想創造這樣一個節點這
node* startNode = new node(startX, startY, 0, 0, 0, 0, null)
但是它給我一個標識符「空」是未定義的錯誤
使您的班級名稱首都 – 2013-05-01 22:31:41