I've got code:
[CODE=cpp]struct Cell{
list<int> vertices;
bool discrete;
Cell* nextCell;
}
struct SearchNode{
Cell* partition;
SearchNode* nextSearchNode;
}
bool isDiscrete(Cell * c){
while(c!=NULL){
if(!c->discrete)
return false;
c = c->nextCell;
}
return true;
}
void stabilise(Searc hNode* s){
.......
Cell* c = s->partition;
isDiscrete(c);
}[/CODE]
after isDiscrete(c) call, c address never change, it always point to head. Any idea?
[CODE=cpp]struct Cell{
list<int> vertices;
bool discrete;
Cell* nextCell;
}
struct SearchNode{
Cell* partition;
SearchNode* nextSearchNode;
}
bool isDiscrete(Cell * c){
while(c!=NULL){
if(!c->discrete)
return false;
c = c->nextCell;
}
return true;
}
void stabilise(Searc hNode* s){
.......
Cell* c = s->partition;
isDiscrete(c);
}[/CODE]
after isDiscrete(c) call, c address never change, it always point to head. Any idea?
Comment