Hi Larray,
On 11/15/11 22:26, Jayden Shui wrote:Hi Jayden,
> Hello All,
>
> I have trouble in using filtering streams with cin in the following code:
>
> #include <boost/iostreams/filtering_stream.hpp>
> #include <iostream>
>
> namespace io = boost::iostreams;
>
> int main()
> {
> io::filtering_istream in;
> in.push(std::cin);
>
> int i;
> in >> i;
> std::cout << i << '\n';
> in >> i;
> std::cout << i << '\n';
> }
>
> I have to input two integers and ctrl+z to terminate the input from
> screen. How can I input 1 integer, output it, then input another one and
> output it, which like the conventional std::cin?
>
It sounds like filtering_istream, in, is buffering its input.
Is there some filtering_istream option for unbuffered input?
If so, try that.
HTH,
-Larry
_______________________________________________
Boost-users mailing list
Boost-users@lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/boost-users