In c++ I need to run the loop continuously until I type a particular alphabet or symbol. Is there any function for this? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

In c++ I need to run the loop continuously until I type a particular alphabet or symbol. Is there any function for this?

Iam trying a car game.

1st May 2021, 6:39 AM
Giridharan RV
Giridharan RV - avatar
3 Answers
0
Use such types of condition If(your function if this returning value == your aplhabet) Print statements Else do something what u want to do
1st May 2021, 7:10 AM
A S Raghuvanshi
A S Raghuvanshi - avatar
0
Problem is, the loop will stop to get input but I want it to run until not a specific alphabet but 3 to 4 alphabets. U know that 1 for pause option 1for left side etc. It's like temple run😅
1st May 2021, 7:56 AM
Giridharan RV
Giridharan RV - avatar
0
Make infinite loop and count these symbols or whatever, if you get specific number, break out of the loop: while(true){ if(condition==true) count++; if(count==4) break; } Or just chceck that count as while condition: while(count<4)
1st May 2021, 8:19 AM
Michal Doruch