O
O
OCCASS OCCASSOVICH2020-06-22 22:17:31
C++ / C#
OCCASS OCCASSOVICH, 2020-06-22 22:17:31

What is the correct way to specify an argument in a while loop in C++?

Hello! Started learning C++. I have a question here. How to pass a global bool variable as an argument to a while loop.

bool exit = false;
while (!::exit){
//что-то
}

Error C2659.
Thanks in advance! Do not judge strictly)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
NitroFuNyx, 2020-06-25
@OCCASS

For your while to work, you need the condition in brackets to be true, which means exit = true and your "wile" works

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question