New course! Every coder should learn Generative AI!
Try a free lesson+ 2
While loop problem maybe?
In main() theres a while(true), and in the end theres break; also an if(!logout) then will not break the loop, the problem is when i run this code in OnlineGDB, it just display nothing and done with code 0, please help me 👍 https://sololearn.com/compiler-playground/cdy8kC8MCSls/?ref=app
3 Answers
+ 2
Sorry, I'm not really across c++, but maybe changing your login variable to a boolean True/False instead of a 0 could help. If the 0 and 1 already are that, maybe you need to check your break conditions in another way.
+ 1
you guessed right, its the infinite loop. Why not use a multithread?
0
Alright, thanks man for answering my question