V
Venkat
Hello All.
I am having a trouble creating a Object in Case Label, and calling the
Member Function outside the Switch. Can some one please help me..??
My code looks like
int main()
{
int number;
cout <<"1. Chevy"<<endl;
cout << "2. Toyota"<<endl;
cout << "enter a number"<<endl;
cin >> number;
switch(number)
{
case 1:
{
Chevy o;
}
break;
case 2:
{
Toyota o;
}
break;
default:
{
Auto o;
}
break;
}
o.Description();
return 0;
}
In this case I want to call the Description Member Function depending
on the Object.
But the Compiler does not know about "o". How can I implement this.??
Thanks in advance
-Venkat
I am having a trouble creating a Object in Case Label, and calling the
Member Function outside the Switch. Can some one please help me..??
My code looks like
int main()
{
int number;
cout <<"1. Chevy"<<endl;
cout << "2. Toyota"<<endl;
cout << "enter a number"<<endl;
cin >> number;
switch(number)
{
case 1:
{
Chevy o;
}
break;
case 2:
{
Toyota o;
}
break;
default:
{
Auto o;
}
break;
}
o.Description();
return 0;
}
In this case I want to call the Description Member Function depending
on the Object.
But the Compiler does not know about "o". How can I implement this.??
Thanks in advance
-Venkat