|
|
back to boardCommon Boardstd::istream >> std::string wrong??? Posted by Mesh 1 Jul 2008 16:49 066f948f-707f-45a3-98be-2d66cabdf143 066f948f-707f-45a3-98be-2d66cabdf143(15): error: no operator ">>" matches these operands operand types are: std::istream >> std::string cin >> number; ^ 066f948f-707f-45a3-98be-2d66cabdf143(43): error: no operator "<<" matches these operands operand types are: std::ostream << std::string cout << number << endl; ^ compilation aborted for 066f948f-707f-45a3-98be-2d66cabdf143 (code 2) When I try to compile, I get this. But I checked my solution to problem 1002, and there I used cin >> string, without any problem. Re: std::istream >> std::string wrong??? #include <iostream> #include <sstream> using namespace std; ... string s; cin >> s; ... cout << s; ... Re: std::istream >> std::string wrong??? Posted by Mesh 1 Jul 2008 19:13 Yeah thx, now it works ;) |
|
|