D
Don Hedgpeth
So I have this piece of code running and it comes from a program posted
last night under nested problems.
When I run this piece the program will return that the conditional on the
line after the for loop is true and print but never enters the scope of
the nested if statment.
Please any help will be greatly appreciated.
TreeNode * getFlagNode() {
printf("IN GETFLAG!\n");
vector< TreeNode *>::iterator p1;
for(p1 = children->begin();p1 !=
children->end();++p1){
printf("%d\n", (*p1)->payload->getX()==maze->get_flag_row() &&
(*p1)->payload->getY()maze->get_flag_col());
if((*p1)->payload->getX()
== maze->get_flag_row() && (*p1)->payload->getY() == maze->get_flag_col())
{
printf("RETURN NEXT");
return *p1;
}
}
}
last night under nested problems.
When I run this piece the program will return that the conditional on the
line after the for loop is true and print but never enters the scope of
the nested if statment.
Please any help will be greatly appreciated.
TreeNode * getFlagNode() {
printf("IN GETFLAG!\n");
vector< TreeNode *>::iterator p1;
for(p1 = children->begin();p1 !=
children->end();++p1){
printf("%d\n", (*p1)->payload->getX()==maze->get_flag_row() &&
(*p1)->payload->getY()maze->get_flag_col());
if((*p1)->payload->getX()
== maze->get_flag_row() && (*p1)->payload->getY() == maze->get_flag_col())
{
printf("RETURN NEXT");
return *p1;
}
}
}