Quantcast
Channel: How do I loop a statement in c++ - Stack Overflow
Viewing all articles
Browse latest Browse all 4

How do I loop a statement in c++

$
0
0

I want to loop a question and make it say "press Y to continue or N to quit" but I don't quite know how. I tried to do a while loop but they haven't worked well. Here's the code:

    cout << "press Y to play again or anything else to close: ";    cin >> val;    if (val != "Y"&& val != "y")    {        spelaIgen = false;    }}

Viewing all articles
Browse latest Browse all 4

Latest Images

Trending Articles





Latest Images