fstream with old IO file manage?

Dirk Broer dbroer at matricsrfid.com
Wed Nov 13 21:24:21 GMT 2002


In the unofficial C++ standard many C++ implementations (including gnu) had 
the ability to attach an istream or ostream to an already opened file 
descriptor.

To my knowledge that is not in the official C++ standard.  There are talks 
that it was an oversight or perhaps the intellectuals on the ISO commitee 
wanted a certain level of purity or abstraction from the underlying operating 
systems api.

Gnu with version 3.2 is attempting to track the standard as close as possible, 
thus its no longer possible to do what you want.

Finally, 0 is translated to the null pointer ( a special property of the 
number 0) and I'm not exactly sure which constructor gets called as a result.

Can you use cin instead?  cin is supposed to be an istream that is opened to 
read from stdin.

Dirk

On Tuesday 12 November 2002 02:49 pm, you wrote:
> Hi all:
>
> I have a project that read from the stdin. I did this
>
> ifstream f (0);
>
> and it worked with gcc 2.96, but with the new gcc 3.2 dont (and its the new
> libstdc++), the debugger crach, and the executable never end.
> Whould some body tell me a new way to do this in the new stdlib c++ or a
> way to do this with the stdio lib?
>
> thanks and best reg at rds
> PD: sorry if this is offtopic, is it?
>
> Israel


-
to unsubscribe from this list send an email to kdevelop-request at kdevelop.org with the following body:
unsubscribe »your-email-address«



More information about the KDevelop mailing list