Y
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
VikingCoder
4510 days ago
Oh right. My brain was stuck in another language. Wow, I forgot how much I'd forgotten about C++.
link
JoeAltmaier
4507 days ago
Actually that's just C (name nesting)
link