W
W
wexwellencex2022-04-07 11:24:05
C++ / C#
wexwellencex, 2022-04-07 11:24:05

How to break a loop in C++ when a variable is changed?

How to interrupt the loop in C++ when the variable is
changed The loop monitors the button click, I click on the button the loop should end
AND the loop should run no more than 20 times

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Evgeny Petryaev, 2022-04-07
@Gremlin92

int iter=0;
for(;;)
{
    if(iter++>20)
        break;
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question