Listing 3 The canonical example illustrating name lookup in nested classes

 1: struct X
 2:     {
 3:     static int i;   // 3
 4:     struct Y
 5:             {
 6:             int i;       // 2
 7:             void f();
 8:             };
 9:     };
10:
11: int i;              //4
12:
13: void X::Y::f()
14:     {
15:     int i;          // 1
16:     i = 5;
17:     }

// End of File