Skip site navigation (1)Skip section navigation (2)
Date:      18 Dec 1996 08:41:39 +0100
From:      Frank Nobis <fn@radio-do.de>
To:        John Fieber <jfieber@indiana.edu>
Cc:        hackers@freebsd.org
Subject:   Re: Weired c++ behaviour regarding iostreams
Message-ID:  <ygen2vcfgek.fsf@trinity.radio-do.de>
In-Reply-To: John Fieber's message of Tue, 17 Dec 1996 20:36:01 -0500 (EST)
References:  <Pine.BSI.3.95.961217202935.280F-100000@fallout.campusview.indiana.edu>

next in thread | previous in thread | raw e-mail | index | archive | help
>>>>> "John" == John Fieber <jfieber@indiana.edu> writes:

    John> On 18 Dec 1996, Frank Nobis wrote:
    >> ifstream file;

    John> ...

    >> file.ifstream("stream1.cc");

    John> It works if you combine these to:

    John>   ifstream file("stream1.cc");

    John> Off the top of my head, the original looks a bit suspicious,
    John> calling a constructor after the object is already
    John> constructed, but I'm a C++ novice...

That is the point. One can't call an constructor twice.

    John> The original bit of code wouldn't even compile on SunPRO CC:

    John> "stream1.cc", line 19: Error: ifstream is not a member of
    John> ifstream.

Looks like different implementation. Even compiling with -O -Wall
gives no warning with gcc.

    John> -john

Thanks for your help

Regards
	Frank
-- 
 Frank Nobis				Email: fn@Radio-do.de  PGP AVAILABLE
 Landgrafenstr. 130			dg3dcn   http://www.radio-do.de/~fn/
 44139 Dortmund	    Powered by FreeBSD  Fax: +49 231 7213816



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?ygen2vcfgek.fsf>