Discussion:
std::cout problem
(too old to reply)
Alex
2009-09-18 02:09:10 UTC
Permalink
I wrote a console_based application, full of such codes
///code start
cout << "blah blah blah" << endl
///code ends

after running one night, it could not show "blah blah blah" any
longer, and I'm sure the application was still alive, so confusing,
anyone who would point me out? thanks a lot.
Martin T.
2009-09-18 07:36:02 UTC
Permalink
Post by Alex
I wrote a console_based application, full of such codes
///code start
cout << "blah blah blah" << endl
///code ends
after running one night, it could not show "blah blah blah" any
longer, and I'm sure the application was still alive, so confusing,
anyone who would point me out? thanks a lot.
Any stream can go bad/fail in certain situations. When that happens, any
output send to it will just be ignored.

If you want to track down where it happens one quick option may be to
enable exceptions for cout (see MSDN basic_ios::exceptions ) and running
your program under the debugger.

br,
Martin
Alex
2009-09-21 09:18:16 UTC
Permalink
Post by Martin T.
Post by Alex
I wrote a console_based application, full of such codes
///code start
cout << "blah blah blah" << endl
///code ends
after running one night, it could not show "blah blah blah" any
longer, and I'm sure the application was still alive, so confusing,
anyone who would point me out? thanks a lot.
Any stream can go bad/fail in certain situations. When that happens, any
output send to it will just be ignored.
If you want to track down where it happens one quick option may be to
enable exceptions for cout (see MSDN basic_ios::exceptions ) and running
your program under the debugger.
br,
Martin
Thank you for your information, I'll dig into them.

Loading...