0
How can I use a FOR operator in an other FOR operator?
7 odpowiedzi
+ 4
for() is not an operator, but is a keyword...
+ 3
you mean nested loop
for (condition) {
for (condition) {
}
}
+ 2
@Timon Paβlick
Sorry, I thought keywords and functions were the same:
https://stackoverflow.com/questions/6054672/whats-the-difference-between-a-keyword-or-a-statement-and-a-function-call
+ 1
for is not a function, for is the key word to initiate a normal or range based for loop.
+ 1
You don't need to apologize for not knowing something, that's why we're here. ( ;
+ 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.
0
No? It won't compile.