My code looks like this,
string aString;
cin >> aString;
cout << \"This is what cin gets:\" << aString << endl;
getline(cin, aString)
When you mix standard stream extraction with getline, you will sometimes have getline return the empty string. The reason for this is that if you read input with >>, the newline character entered by the user to signal that they're done is not removed from the input stream. Consequently, when you call getline, the function will read the leftover newline character and hand back the empty string.
To fix this, either consistently use getline for your input, or use the ws stream manipulator to extract extra white space after a read:
cin >> value >> ws;
This will eat up the newline, fixing the problem.
Hope this helps!