Hallo,
ich habe eine Anfängerfrage:
Kompiliert nicht mit dem Fehler:
hello_world_tests.cpp(132) : error C2679: binary '<<' : no operator found which takes a right-hand operand of type 'std::string' (or there is no acceptable conversion)
c:\program files\microsoft visual studio 8\vc\include\ostream(656): could be 'std::basic_ostream<_Elem,_Traits> &std:
perator <<<char,std::char_traits<char>>(std::basic_ostream<_Elem,_Traits> &,const char *)'
Kann man einen String nicht einfach so ausgeben?
Danke für eure Hilfe.
Peter
ich habe eine Anfängerfrage:
PHP:
#include <iostream>
#include <string>
using namespace std;
int main ()
{
string str = "Hallo Welt";
cout << str << endl;
cin.get();
return 0;
}
Kompiliert nicht mit dem Fehler:
hello_world_tests.cpp(132) : error C2679: binary '<<' : no operator found which takes a right-hand operand of type 'std::string' (or there is no acceptable conversion)
c:\program files\microsoft visual studio 8\vc\include\ostream(656): could be 'std::basic_ostream<_Elem,_Traits> &std:

Kann man einen String nicht einfach so ausgeben?
Danke für eure Hilfe.
Peter