i want to break out of this do-while loop but, i wont just get out of the loop,
but when i change the waitkey argument to 1 it breaks but the other codes does not run... any help pls
Because you're using the comma operator, while (true, cout << " Try Again!!!" <<endl);
is equivalent to while (cout << " Try Again!!!" <<endl);
imshow("img", img), waitKey(0);
is equivalent to
1 2
imshow("img", img);
waitKey(0);
(somebody correct me if I am wrong on this last one because this is just my assumption).
Just wanted to point that out.
If your problem is that you're stuck at waitKey(0), then that has nothing to do with the do-while loop.
If you want us to help you then you need to give us more details as to what those functions do, what you're expecting, what you're getting, what you want.
the function accepts two input, then apply the addweighted function to the image and display the result, the first image, the second and the result of the two image, the waitkey is suppose to wait till any key is pressed and then it display the other one, which works well, but the last waitkey(0), is suppose to help execute the below code but it is not doing that