do this
}
else if((command2=="C")||(command2=="c"))
{
do this
}
else if((command2 =="D") ||(command2== "e"))
{
do this
}
else if((command2 =="E") ||(command2== "e"))
{
do this
}
else if((command2 =="F") ||(command2== "f"))
{
do this
}
else
{
cout<<"invalid"<<endl;
cout<<"enter again"<<endl;
give_command();
}
}
/code]
hey
in this code....i have been trying to execute some commands
but this cin.ignore() and getline functions are giving me troubles
if i do not use cin.ignore() then all the if blocks of give_command are skipped and on console i can see
invalid
enter again
after using cin.ignore()
getline is skipping first character of my input and also command is not getting executed.