calling std::cout.rdbuf() produces syntax error

Posted by Mikepote on Stack Overflow See other posts from Stack Overflow or by Mikepote
Published on 2010-04-10T16:00:09Z Indexed on 2010/04/10 16:03 UTC
Read the original article Hit count: 250

Filed under:
|
|

Maybe I missed something, but I cant figure out why Visual Studio 2008 isn't seeing the rdbuf() procedure. Here is my code:

16. #include "DebugBuffer/BufferedStringBuf.h"
17.
18. BufferedStringBuf debug_buffer(256);
19. std::cout.rdbuf(&debug_buffer);

The BufferedStringBuf class is from this page: http://www.devmaster.net/forums/showthread.php?t=7037

Which produces the following error:

...src\main.cpp(19) : error C2143: syntax error : missing ';' before '.'

All I want to do is redirect std::cout to the Visual Studio Output window using OutputDebugString()..

© Stack Overflow or respective owner

Related posts about cout

Related posts about c++