Hacker News new | ask | show | jobs
by plorkyeran 4510 days 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.
1 comments

Oh right. My brain was stuck in another language. Wow, I forgot how much I'd forgotten about C++.
Actually that's just C (name nesting)