Blog Archives

C++ Variable Shadowing

In C++, you can declare a variable in a derived class with the exact same name as the base class. This is allowed because each variable is properly scoped. Shadowing can lead to some fairly unpredictable behavior. Consider a class

Tagged with: , , ,
Posted in Uncategorized
Design a site like this with WordPress.com
Get started