How to pause the loop after pressing a key?

I have a loop like this,

for (int i = 0; i <= a; i++) {
    for (int j = 0; j <= b; j++) {
        cout << "(" << i << "," << j << ")" << test_resize.at<uchar>(i, j);
    }
}

I want to do a pause after cout during the loop if I press a button, for example the space, and return running the loop after another press of the space button. How can I do this? Thanks.

0 Comment

NO COMMENTS

LEAVE A REPLY

Captcha image