Say if i had a user enter a character
Code:
printf("Enter operation code: ");
scanf("%s", operCode);
if(operCode == 's')
{
some code to run
}
if(operCode == 'i')
{
some code to run
}
if(operCode == 'u')
{
some code to run
}
if(operCode == 'p')
{
some code to run
}
if(operCode == 'q')
{
some code to run
}
now say none of those characters were entered, why does this always return true or have no effect reguardless if i entered a right caracter ???
Code:
if(operCode != 'i', 's', 'u', 'p', 'q')
{
some code to run
}
how would i tell it...if none of these letters weren't entered, then run the condition ?! i've tried using both ' ' and " "...i also tried having it run first and last but no luck
thanks for the help