Your mixing of getline and cin is the cause of the problem here. After you enter the age using cin and press the enter key, cin converts the numbers entered and stores them into age however it leaves the newline/enter character in the input buffer. This newline character is read in by the next getline statement and you program is thinking that you pressed enter at this point to skip entering in anything for the alias. You can try putting cin.ignore(80,'\n'); after the cin statement and I think that should eat up any trailing newline characters. This happens again where you cin the yesorno varaible and then use getline on the filename.