Skip to content
Better HN
Top
New
Best
Ask
Show
Jobs
Search
⌘K
undefined | Better HN
0 points
plorkyeran
12y ago
0 comments
Share
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.
0 comments
default
newest
oldest
VikingCoder
12y ago
Oh right. My brain was stuck in another language. Wow, I forgot how much I'd forgotten about C++.
JoeAltmaier
12y ago
Actually that's just C (name nesting)
j
/
k
navigate · click thread line to collapse