i input a sentence " i love eat".how can wanto to get c++ to get a full sentence..
#include <iostream>
#include <string>
using namespace std;
void echo(string message)
{
cout << message << endl;
}
int main()
{
cout << "Enter your word: ";
string word; // place declaration near its use
cin>>word
echo(word);
}
but i only get the first word,,how to get the sentence..
i try to use getline(cin,word) but error show up