[Solved] Function receiving different value than passed
At least part of the problem is that you are not understanding how operators work in C++. for(i=1;i<=n,completed==0;i++){ The expression i<=n,completed==0 has the effect of evaluating i <= n, discarding the result, then evaluating completed == 0, and giving the result of that. So the end condition of the loop is essentially completed == 0. … Read more