error C2679: binary '<<' : no operator defined which takes a right-hand operand of type '' (or there is no acceptable conversion
2007-06-07 13:30
639 查看
简单程序
#include <iostream.h>
#include <string>
#include <list>
#include <algorithm>
using namespace std;
PrintIt (string& StringToPrint) {
std::cout<<StringToPrint<<endl;
//; cout<<"asdfds"<<endl;
}
int main (void) {
list<string> FruitAndVegetables;
FruitAndVegetables.push_back("carrot");
for_each (FruitAndVegetables.begin(), FruitAndVegetables.end(), PrintIt);
}
如果 #include <iostream.h> 则有错误,
错误如题所示:
error C2679: binary '<<' : no operator defined which takes a right-hand operand of type '' (or there is no acceptable conversion)
把其中的 “.h”去掉,则错误消失,能够正常运行!
#include <iostream.h>
#include <string>
#include <list>
#include <algorithm>
using namespace std;
PrintIt (string& StringToPrint) {
std::cout<<StringToPrint<<endl;
//; cout<<"asdfds"<<endl;
}
int main (void) {
list<string> FruitAndVegetables;
FruitAndVegetables.push_back("carrot");
for_each (FruitAndVegetables.begin(), FruitAndVegetables.end(), PrintIt);
}
如果 #include <iostream.h> 则有错误,
错误如题所示:
error C2679: binary '<<' : no operator defined which takes a right-hand operand of type '' (or there is no acceptable conversion)
把其中的 “.h”去掉,则错误消失,能够正常运行!
相关文章推荐
- error C2679: binary '<<' : no operator defined which takes a right-hand operand of type '' (or there is no acceptable conversion
- 解决 C++错误 error C2679: binary '=' : no operator defined which takes a right-hand operand of type 'class CString' (or there is no
- 错误 1 error C2679: binary '<<' : no operator found which takes a right-hand operand of type 'std::str
- error C2679: binary '<<' : no operator found which takes a right-hand operand of type 'std::wstring'
- Error 1 error C2679: binary '>>' : no operator found which takes a right-hand operand of type 'std::
- C2679: binary '<<' : no operator found which takes a right-hand operand of type 'const std::basic
- error C2679: binary '<<' : no operator defined which takes a right-hand operand of type 'class Stude
- error C2679: binary '<<' : no operator found which takes a right-hand operand of type 'std::wstring'
- error C2679: binary '<<' : no operator found which takes a right-hand operand of type 'std::string'
- error C2679: binary '<<' : no operator found which takes a right-hand operand of type 'std::string'
- error C2678: binary '>>' : no operator found which takes a left-hand operand of type 'std::
- C++,如何输出string类型的数据(报错:no operator defined which takes a right-hand operand of type 'class std::bas)
- error C2677: binary '-' : no global operator defined which takes type 'class CString' (or there is n
- error C2679: binary ',class std::allocator >' (or there is no accept
- There is no ViewData item of type 'IEnumerable<SelectListItem>' that has the key ''.
- error C2679: binary '<<' : no operator defined which takes a right-hand operand of type 'class std::basic_s
- There is no result type defined for type 'json' mapped with name 'success'.
- There is no result type defined for type 'json' mapped with name 'success'.
- struts2 配置错误There is no result type defined for type 'json'
- Caused by: There is no result type defined for type 'json' mapped with name 'rebback'. Did you mean