Hi, can someone help, I want to write "if statements" on parts of a string and I am not having any success. Here is some sample code to show you what i mean.
Thanks
{
string day ;
cout << "What day is it? " << endl ;
getline(cin, day) ;
if (day[0] == "s" || day[0] == "S" )
{
cout << "Sorry i don’t work on Saturdays of Sundays" ;
}
}
or
{
string day ;
cout << "What day is it? " << endl ;
cin >> day ;
if (day[0] == "s" || day[0] == "S" )
{
cout << "Sorry i don’t work on Saturdays of Sundays" ;
}
}