The extraction operator (>>) on cin leaves the newline char in the buffer, causing the next call to getline to seemingly skip. To fix this, add the following code before you call getline:
1 2
cin.sync(); //clear buffer
cin.clear(); //reset error flags, just in case