Hi.First time poster, please be gentle with me lol.
I'm trying to work out why this code fails at
if I use double quotes instead of the single quotes which was used in the example from the book.
getline( cin, username, "\n");
Here is the full code that works with single quotes at each "getline line". I guess what I'm asking is if there is a difference or am I using the wrong header? I was sure that you could use either but I cant find where I read that now.
Thanks for any assistance.
using namespace std;
int main ()
cout << "Enter your username: " << "\n";
getline( cin, username, '\n');
cout << "Enter your password: " << "\n";
getline ( cin, password, '\n');
if (username == "root" && password == "xyzzy" )
cout << "Access Allowed" << "\n";
cout << "Bad username or password. Access Denide!" << "\n";
Oh I'm using Code::Blocks 13.12! if that makes any difference.