The (char n) would be receive either a "Y" or a "N" from the user.
bool YesNo(char n) //Prototype Function
{
if (n == "Y")
return 1; // true
else
return 0; //false
}
The (char n) would be receive either a "Y" or a "N" from the user.
bool YesNo(char n) //Prototype Function
{
if (n == "Y")
return 1; // true
else
return 0; //false
}
You are not comparing char
, instead you are comparing a string. A char can be compared in following way -
if (n == 'Y')
Just use a single quote for character and double quote for string. Change your if
condition as above. It'll work fine.