by zhemao · 12y ago · 0 comments
Also, I can't believe I forgot to mention this in the post, but both for and pfor can sweep multiple iterators, so
for (i in 0:10, j in 0:5) {
}
Is equivalent to for (i = 0; i < 10; i++) {
for (j = 0; j < 5; j++) {
}
}* http://notonlyluck.com/2013/07/23/reasons-to-join-a-startup-...
* http://notonlyluck.com/2013/07/24/more-thoughts-on-reasons-t...
for(i=0,j=0;i<10;j=(j+1)%5, j==0?i++:){
}
Not that you ever would of course, but it does demonstrate the power of for loops in C.