from the pointer problem thread.
I got this,
void is_valid (char& s)
{
return s=='1' || s=='2';
}
void is_submenu(char& m)
{
return m=='x' || m=='y';
}
// then i'm using it in my main.
char choice;
cout<<"enter your choice";
cin>> choice;
if( is_valid(choice)
{
if(letter == '1')
{
// code for link list is here
if( one of the pointers is null
{
// pointers points to link list.
}
else
{ //does something else }
}
else if(letter == '2')
{
cout<<"what would you like from the submenu?";
if(is_submenu(choice))
{
if(choice=='x')
{
//does something
}
else if(choice =='y')
{
//does something
}
}
}
Everything works until, the submenu part, after I hit 2 it works.
Then I put x, or y. Nothing happens.