0

How can I use a FOR operator in an other FOR operator?

27th Nov 2017, 11:46 AM
Hadi Azizi
Hadi Azizi - avatar
7 odpowiedzi
+ 4
for() is not an operator, but is a keyword...
27th Nov 2017, 1:02 PM
Kinshuk Vasisht
Kinshuk Vasisht - avatar
+ 3
you mean nested loop for (condition) { for (condition) { } }
27th Nov 2017, 11:55 AM
Andika Romansyah
27th Nov 2017, 5:07 PM
Kinshuk Vasisht
Kinshuk Vasisht - avatar
+ 1
for is not a function, for is the key word to initiate a normal or range based for loop.
27th Nov 2017, 4:23 PM
Timon Paßlick
+ 1
You don't need to apologize for not knowing something, that's why we're here. ( ;
27th Nov 2017, 5:10 PM
Timon Paßlick
+ 1
imagine it: for(init; condition; increament){ for(init; condition; increament){ for(init; condition; increament){ some statements; } } } this code does like a watch. the innermost for counts seconds, the middle one counts minutes, and the outer counts hours.
8th Dec 2017, 8:30 AM
Mahdi Ghahramani
Mahdi Ghahramani - avatar
0
No? It won't compile.
8th Dec 2017, 9:38 AM
Timon Paßlick