not all paths return a vale
hey all, my compiler says that not all these paths return a value, but to my eye they do. can someone help spot my error? thanks in advance :)
Code:
]
char Game::mf_game_displayOptions(int options)
{
char choice='h';//local only
if (options==1)
{ bool choiceCheck=false;
do
{
cout<<endl<<endl<<endl<<"count under con"<<"<B>unt, <L>eft grounder, <R>ight grounder, "
<<"<S>acrafice fly, <H>ome run"<<endl;
cin>>choice;
choice=tolower(choice);
if (choice=='b' || choice=='l' || choice=='r'
|| choice=='s' || choice=='h')
{
choiceCheck=true;
return choice;
}
else
{
clrscr();
cout<<"you've entered an invalid option, please change it.";
choiceCheck=false;
}
}while(choiceCheck==false);
}
else
{return (choice);}
}