to start of let me just explain what i am trying to accomplish here, basicly im doing some basic pathfinding in a game, and for this i have constructed a very simple class called Node and inside of node i have some variables and functions, but in order for my pathfinding algorithm to work i will need to be able to go back to the parent node of the current node that i am looking at, so i need every Node to contain their parent Node, it mgiht be easier to understand in code so ill write down some sample code.
i have tried doing this but im just getting an error like "Incomplete type is not allowed" so im guessing im doing something very wrong here.
class Node {
int f_score, g_score, h_score; //just a few variables used for pathfinding.
Node parent_node; //parent node as explained above
Node(void); //just a function.
}
so its pretty easy to see what im trying to accomplish here, im just trying to have an object of the same class kind of, sorry if im hard to understand, but i tried my best to explain, any help will be greatly appreciated.