From owner-freebsd-hackers Tue Dec 17 23:42:09 1996 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.4/8.8.4) id XAA22093 for hackers-outgoing; Tue, 17 Dec 1996 23:42:09 -0800 (PST) Received: from trinity.radio-do.de (fn@trinity.Radio-do.de [193.101.164.3]) by freefall.freebsd.org (8.8.4/8.8.4) with ESMTP id XAA22085 for ; Tue, 17 Dec 1996 23:41:58 -0800 (PST) Received: by trinity.radio-do.de (8.7.6/CLIENT-1.2.7-h) via EUnet id IAA08972; Wed, 18 Dec 1996 08:41:39 +0100 (MET) To: John Fieber Cc: hackers@freebsd.org Subject: Re: Weired c++ behaviour regarding iostreams References: From: Frank Nobis Date: 18 Dec 1996 08:41:39 +0100 In-Reply-To: John Fieber's message of Tue, 17 Dec 1996 20:36:01 -0500 (EST) Message-ID: Lines: 37 X-Mailer: Red Gnus v0.74/XEmacs 19.14 Sender: owner-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk >>>>> "John" == John Fieber 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