[Home]
[Edit this page]
[Recent Changes]
[Special Pages]
[Help]
CppStreamOutOperator
The answer is to #include <string>, which contains the definition of the function lacking.
[Edit this page] [Page history] [What links here] [Discuss this topic] [Printer Friendly]
CppStreamOutOperator
(C++) Stream out operator <<
This operator is used most comming using the std::cout stream:int main() { std::cout << "Hello world" << std::endl; return 0; }
- include <iostream>
Compile error 'operator<<' not implemented in type 'ostream' for arguments of type 'std::string'
Caused by the following simple code:int main() { std::string s = "Hello"; std::cout << s; }
- include <iostream>
- include <vector>
The answer is to #include <string>, which contains the definition of the function lacking.
#include <string> int main() { std::string s = "Hello"; std::cout << s; }
- include <iostream>
- include <vector>
Questions
[Edit this page] [Page history] [What links here] [Discuss this topic] [Printer Friendly]
