#include <iostream>
#include <string>
usingnamespace std;
int main()
{
string mystring;
cout<<" Enter your name: ";
getline (cin,mystring);
if (mystring == 'vlad'){
cout<<" Hi vlad....weve been waiting for you...";
}
else {
cout<<" Hello, "<<mystring<<" how are you today?";
}
cin.get();
return 0;
}
i seem to be having an error in my if (mystring == 'vlad'
at first i tried withought the ' ' then put those on just incase, not too sure about what else to change
There's actually a pretty good reason for it; double quotes designates a null-terminated string literal (i.e. any string), whereas single quotes are used for individual characters.