home *** CD-ROM | disk | FTP | other *** search
- Xref: sparky gnu.g++.help:1068 comp.lang.c++:11859
- Newsgroups: gnu.g++.help,comp.lang.c++
- Path: sparky!uunet!taumet!steve
- From: steve@taumet.com (Steve Clamage)
- Subject: Re: Invalid cast and overload in g++
- Message-ID: <1992Jul31.164845.10079@taumet.com>
- Organization: TauMetric Corporation
- References: <1992Jul30.141423.22431@Princeton.EDU>
- Distribution: na
- Date: Fri, 31 Jul 1992 16:48:45 GMT
- Lines: 31
-
- afriend@dew.Princeton.EDU (A. Friend) writes:
-
- >Why does g++ choke on these two lines?
-
- >> overload LogSolution();
-
- The keyword 'overload' is obsolete (has been since 1990), and need
- not be supported by current compilers. Get rid of 'overload' keywords
- in your code.
-
-
- >> istream in = istream(open(savefile, O_RDONLY));
-
- This is not a good way to create a stream object. Use initialization
- by constructor instead:
-
- istream in(open(savefile, O_RDONLY));
-
- Further, this method of creating an istream is obsolete (assuming you
- are using iostreams, rather than the pre-1990 old-style streams).
- Probably you should #include <fstream.h> and create an ifstream instead:
-
- ifstream in(savefile)
-
- It may be that you are using very old code, or have an obsolete C++
- textbook. There are a number of good up-to-date books available. I
- recommend "C++ Primer", 2nd edition, by Stan Lippman, Addison-Wesley.
- --
-
- Steve Clamage, TauMetric Corp, steve@taumet.com
- Vice Chair, ANSI C++ Committee, X3J16
-