What i am trying to do is input until user inputs an empty line.
However, it doesn't seem to work.
#include <iostream>
#include <string>
using namespace std;
int main ()
{
string stri;
do
{
getline(cin, stri);
cin >> stri;
}
while (stri != "\n");
cout << stri << endl;
//return 0;
}
getline will not put the new line character in the string. Instead check if the stri is empty.
Thanks alot! That helped!