.Open CS202 session 16 Scoping . Previous -- Exceptions .See ./15.html . Preparation Study Chapter 18 and do Review Questions. Notes: In practice avoid `protected data members` and `private inheritance`! . Due in Hand in one even-numbered question+answer at the start of class. Bonus for Perfect Project 3 today at start of class. .Open Class Work . Dr Schuberts Explanation of friends . What is encapsulation in Computer Programming . List as many Name Scopes as you can . What is shadowing in C++ and is it a good thing . How can you avoid polluting the global scope with constants . What does this function return when called 4 times as shown .As_is int f() {static int c=0; c=c+1; return c; } .As_is ... .As_is cout << f() << "\n"; .As_is cout << f() << "\n"; .As_is cout << f() << "\n"; .As_is cout << f() << "\n"; . What does this return when called 4 times .As_is int f() { int c=0; c=c+1; return c; } . What is the best way to give only derived classes access to data in a base class . How does a function become a friend of a class . Give a well known example of a nested class in the Standard Template Library . When do you create namespaces .Close . Next -- Class Hierarchies .See ./17.html Next project due in next class. Next quiz in next class and on chapters 16,17,18, and P3. (2011 Memorial Day): Holiday on Monday. .Close