Did somebody change the automatic stdout.flush behavior?

Paulo Pinto pjmlp at progtools.org
Thu Feb 17 07:19:03 UTC 2022


On Thursday, 17 February 2022 at 00:36:30 UTC, Ali Çehreli wrote:
> On 2/16/22 16:21, Ali Çehreli wrote:
>
> > the other rule is that reading from stdin flushes stdout
> > automatically.
>
> Now I'm in doubt. That's ancient knowledge (belief) for me from 
> C and C++ days. I swear there was a feature where you could 
> link (or lock, or connect?) an output stream to an input stream 
> and reading from the input stream would automatically flush the 
> output stream.
>
> And I've been under the impression that stdin and stdout were 
> such streams. But the internet does not agree with me. Was I 
> dreaming? Was that a special thing about C++'s cout and cin?
>
> Help! Losing my mind...
>
> Ali
>
> P.S. Regardless, an automatic flush feature would be nice 
> between stdin and stdout. But I wouldn't want that unless it 
> "is a tty". Hm... I think I see now.

I bet you are mixing it up with connecting FILE streams to 
iostreams.

https://en.cppreference.com/w/cpp/io/ios_base/sync_with_stdio


More information about the Digitalmars-d mailing list