更新时间:2023-11-11 20:50:40
c $ c> #include< string> 。此外,如果您没有添加 #include< iostream>
和 #include< vector>
/ p>
I found this compiling error very odd . error C2678: binary '>>' : no operator found which takes a left-hand operand of type 'std::istream' (or there is no acceptable conversion) I'm compiling under MVC++ Express 2010 here's the code :
The error indicate that it's from line 8 .
1 int m;
2 vector <string> grid;
3
4 cin >> m;
5
6 for(int i=0; i<m; i++) {
7 string s;
8 cin >> s;
9 grid.push_back(s);
10 }
You need to #include <string>
. Also if you don't have them add #include <iostream>
and #include <vector>
.