Consider the following code.
class Base1
{
public:
void func1(float x)
{var1 = x;}
private:
float var1;
};
class Derived1: public Base1
{
public:
void func1(int x)
{var1 = x;}
private:
int var1;
};
Is it a good idea to redefine the variable var1 with a new data type (integer in this example)? Is there any problem with this? (e.g.: shadowing!)