Hi,
How to solve the below mentioned problem ?

Light *myobj;
Fan *myobj;
int choice;
cout<<"Select Light (1): ";
cout<<"Select Fan (2): ";
cin>>choice;

if (choice ==1){
Light *myobj = new Light();
}
if (choice ==2){
Fan *myobj = new Fan();
}

FlipUpCommand switchUp(*myobj);

Error:conflicting declaration 'Fan*myobj'