while(true) for this condition ,true is keyword? Or value of true will be considered ,0 will be taken as false otherwise true? | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
+ 2

while(true) for this condition ,true is keyword? Or value of true will be considered ,0 will be taken as false otherwise true?

Conditional operators in c++

17th Jun 2019, 8:58 AM
Born MaD
Born MaD - avatar
1 Resposta
+ 9
true is a keyword and a boolean value too. Its value is 1. while(true) is same as while(1) which means keep running this loop as long as it is true, in simple words it's an infinite loop.
17th Jun 2019, 9:42 AM
blACk sh4d0w
blACk sh4d0w - avatar