Skip to content
Better HN
Top
Best
Ask
Show
New
Jobs
Search
⌘K
0 points
plorkyeran
12y ago
0 comments
Save
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
2 comments · 1 top-level
top
newest
oldest
VikingCoder
12y ago
· 1 in thread
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