+ 6
Is loop do in ruby same as do while loop in c++?
In c++ do while loop will execute the block atleast once even though the condition is false. Does loop do in ruby do the same thing
4 Answers
+ 8
I dont think so... while x < 10 puts x is the same as while x < 10 loop do puts x... I belive.
+ 6
@Supersebi3 Thats what I thought too, It is different from do while loops
+ 5
loop do doesnt take any arguments, it just loops forever like while true
+ 5
loop is like these :
for( ; ; ) { }
while(true) { }
do { } while(true)
#All of these are infinite loops.