0

pretest loop

is there any pre test loop with char(s) as its condition. the code only running when certain char is put into.example the char is 'c' and 'd' only.so if you put any char other that it will get out of the loop. TOTAL NEWBIE HERE. THANK YOU :)

11th Jul 2020, 5:37 PM
Muhammad Yusuff
Muhammad Yusuff - avatar
3 odpowiedzi
0
while(cin>>s){ if(s=='c' || s=='d'){ //Code }else break; }
11th Jul 2020, 5:55 PM
Alejandro Medero
Alejandro Medero - avatar
0
Not char 's' but a few char as my condition
11th Jul 2020, 6:05 PM
Muhammad Yusuff
Muhammad Yusuff - avatar
0
Btw thanks alejandro,i learn something new
11th Jul 2020, 6:06 PM
Muhammad Yusuff
Muhammad Yusuff - avatar