I'm trying to write a function that will read in an operator by utilizing a c string array. The array are "/+-*cCxX". If a a match, return true, if not return false.
Thanks.
1 2 3 4 5 6 7 8 9 10 11
bool readOperator (constchar validO[], char & op)
{
cin >> op;
for (int i = 0; i < 9; i++)
{
if (validO[i]==0)
returntrue;
elsereturnfalse;
}
}