Hi.
I am currently having a problem with pointers to some objects. Suddently the variables on the objects return large unexpected integers, which I assume may result in a pointer problem.
Data flow is a bit complicated but i hope you can see what I am doing:
1 2 3 4 5 6 7
..
//We get the object:
dagnode* ancestorDagNode = globalDag->getVersionNode(ancestorId);
...
//We send it as a array to another function:
globalDag->makeVersion({ancestorDagNode},1,newNode);
...
in globalDag->makeVersion we have:
1 2 3 4 5 6 7 8 9 10 11
void dag::makeVersion(dagnode a[], int numberOfAncestors, LocalVersionNode *rootNode){
...
for (int i = 0; i < numberOfAncestors; i++){
a[i].addChild(newnode);
newnode->addAncestor(&a[i]);
}
...
}
In addAncestor we have:
1 2 3 4 5 6
void dagnode::addAncestor(dagnode * a) {
ancestors[numberOfAncestors] = a;
numberOfAncestors++;
}
No error is found by doing this, but then i later want to get the objects again. I then call this method: