View Single Post
  #8  
Old 10-07-2004, 01:00 AM
jbb
Hill Giant
 
Join Date: Mar 2003
Location: UK
Posts: 242
Default

How to read a string properly in C++.

Code:
#include <iostream>
#include <string>

using namespace std;

int main()
{
   string name; 
   getline(cin, name);
   cout << name << "\n";
}
Reply With Quote