Hi
I ran my code in gdb after it was giving me un-expected results, to
find out why and I found where the problem is but I don't understand
why it happened.
if( username == us && password == pa ) {
cout << "connected. " << endl;
on_off = true;
} else {
cout << "wrong username or password" << endl;
}
*************** *************** *************** *************** ****
(gdb) p username
$6 = 0x805114c "sam"
(gdb) p us
$7 = 0x8051235 "sam"
(gdb) p username == us
$8 = false
(gdb) p password
$9 = 0x8051150 "jesse"
(gdb) p pa
$10 = 0x8051239 "jesse"
(gdb) p password == pa
$11 = false
(gdb) p username == us && password == pa
$12 = false
(gdb)
*************** *************** *************** *************** ****
I was expecting "True" instead of false above.
thanks