Possible Duplicate:
loop with if consition
int i, j, c = 0;
int num = ring.points_.size();
for (i = 0, j = num-1; i < num; j = i++) {
if ((((ring.points_[i].y_ <= pt.y_) && (pt.y_ < ring.points_[j].y_)) ||
((ring.points_[j].y_ <= pt.y_) && (pt.y_ < ring.points_[i].y_))) &&
(pt.x_ < (ring.points_[j].x_ - ring.points_[i].x_) * (pt.y_ - ring.points_[i].y_) / (ring.points_[j].y_ - ring.points_[i].y_) + ring.points_[i].x_))
c = !c;
}
return c;
this is function of "In Side" with parameter as pt(point) and ring(from line-string(list of points))... but here i am not getting if condition inside the loop.