0

Possible Duplicate:
Reading a full line of input

I came across this snippet of code as a way to input a string (not a c string of char type) and have it read the whole line rather than stopping at the first space. Can someone give me an actual example of this where I want to input the line until a newline character is hit?

istream& getline(istream& ins, string& strVar);
Community
  • 1
  • 1

1 Answers1

2

Simple google search of "getline sample": http://msdn.microsoft.com/en-us/library/3ah895zy(v=vs.80).aspx

string s;
getline(cin, s);
Derek
  • 21,828
  • 7
  • 53
  • 61