Thanks for the help . But I have the code cout << name << endl; below that line. Not sure why it did not work. But I fixed it by asking the user to type in his first and last name seperately