3 ms·
C++ has variable shadowing, so that works correctly. for (int i = 0; i < 5; ++i) { for (int i = 0; i < 5; ++i) { printf("hello\n");
by plorkyeran 13y ago
C++ has variable shadowing, so that works correctly.
for (int i = 0; i < 5; ++i) {
for (int i = 0; i < 5; ++i) {
printf("hello\n");
}
}
prints hello 25 times.
- VikingCoder 13y agoOh right. My brain was stuck in another language. Wow, I forgot how much I'd forgotten about C++.
- JoeAltmaier 13y agoActually that's just C (name nesting)