Albrecht Schlosser schrieb:
> Interesting observation(s) on Windows/Cygwin:
>
> The first std::cout with a Null pointer seem to "close" the output
> channel. No more output reaches the console terminal window.
> Does anybody know if this is defined behavior of std::cout ? Or
> is it a bug? Maybe Windows only?
I think this is defined behaviour and I made a test using Linux:
const char* P1= "Test1";
const char* P2= 0;
const char* P3= "Test3";
std::cout << P1 << std::endl;
std::cout << P2 << std::endl;
std::cout << P3 << std::endl;
if (std::cout.badbit)
{
std::cout.clear();
std::cout << "bad" << std::endl;
}
else if (std::cout.failbit)
{
std::cout.clear();
std::cout << "fail" << std::endl;
}
This reproduces "closing of stream" and results in "bad", so iostream
thinks, it is a bad thing to stream a NULL pointer. ;o)
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk