How get a few words from input cin with spaces between them?

HI!
Suppose this piece of code :
1
2
3
4
5
6
7
8
9
10
11
12
13
#include <iostream>
#include <string>

using std :: cout ;
using std :: cin ;
using std ::string ;

int main ()
{
    string line ;
    cin >> line ;
    cout << line ;
}


for example when I enter "I am Ardeshir81" it only outputs "I" , what should I do?
THNX!
Last edited on
use getline(cin, line), it is part of the standard library.

http://www.cplusplus.com/reference/string/string/getline/
Topic archived. No new replies allowed.