Re:Go is Not Python
by 0xffff2 on Thursday June 22, 2017 @06:48PM
(#14615908)
C has no concept of the kind of for loop used in the article, so there is no "how it works" in C.
[ Parent
| on HN ]
Re:Go is Not Python
by dragonwriter on Thursday June 22, 2017 @09:43PM
(#14616624)
While C has no for-in loop, the natural translation of that to a C style for loop and the C address-of operator would work the same way; the key thing is that student is a variable defined outside the loop whose value is modified each iteration, not a fresh variable allocated with each loop iteration.