Also on windows I think cin.getline() will leave the newline in the buffer. I could be wrong though.
Whoops I mean if you use cin >> then cin.getline() it will cause problems because the cin >> leaves the newline in the buffer and cin.getline() reads until the newline is found so it will not read anything. You must put a cin.ignore in there