how to stop while(true) in c++ code example Example: c++ while true loop while (true) { // you can also put 1 or true: while (1) //do stuff }