문제

In my C++ project I'm trying to do this:

 std::ostringstream stream(std::ostringstream::out);

But I'm getting an error:

error C2027: use of undefined type 'std::basic_ostringstream<_Elem,_Traits,_Alloc>'

I'm already including iostream and ostream libraries so I'm not sure why it's treating ostringstream as undefined...

도움이 되었습니까?

해결책

std::ostringstream is defined in <sstream>. <iostream> only contains a forward declaration and <ostream> does not help at all.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top