韶子

梦想皆有神助...
程序调试小bug

------------------------------------------------------------------------------------------

一段简单的代码:

std::ifstream input (fileName);   

while (input) {
  string s;
  input >> s;
  cout << s << endl;
};

编译报错:

error C2679: binary '>>' : no operator found which takes a right-hand operand of type 'std::string' (or there is no acceptable conversion)

原来是忘了#include <string>了

 

posted on 2012-04-20 21:46  韶子  阅读(149)  评论(0编辑  收藏  举报