delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2003/01/28/08:45:08

From: "Lawrence Rust" <lvr AT nospam DOT softsystem DOT co DOT uk>
Newsgroups: comp.os.msdos.djgpp
References: <200301280550 DOT h0S5ohlA017021 AT chac DOT its DOT uow DOT edu DOT au> <b15tch$en6$1 AT nets3 DOT rz DOT RWTH-Aachen DOT DE>
Subject: Re: scan() in c++
Lines: 56
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.50.4807.1700
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
Message-ID: <qMvZ9.6040$RZ.55713@newsfep4-win.server.ntli.net>
Date: Tue, 28 Jan 2003 13:41:38 -0000
NNTP-Posting-Host: 62.253.142.146
X-Complaints-To: abuse AT ntlworld DOT com
X-Trace: newsfep4-win.server.ntli.net 1043761302 62.253.142.146 (Tue, 28 Jan 2003 13:41:42 GMT)
NNTP-Posting-Date: Tue, 28 Jan 2003 13:41:42 GMT
Organization: ntl Cablemodem News Service
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

"Hans-Bernhard Broeker" wrote...
> Y Chen <yc12 AT uow DOT edu DOT au> wrote:
>
> > #include <iostream>
> > #include <cstdlib>
> > //#include <fstream>
> > using namespace std;
>
> > //#include <stdlib.h>
> > #include <stdio.h>
> > //#include <iostream.h>
>
> > #include <iomanip.h>
> > #include <new.h> // for memory error handling
>
> This is a horrible mess.  You're mixing new-style C++ standard headers
> (without .h) and old-style ones (with .h).  And on top of all that,
> you throw C headers into the mix.  While this may still work, if
> you're lucky, it's a rather certain path to confusion.  Please try to
> avoid that.

This is a criticism of the quagmire that has become the C++ standard
(template) library.  IMHO unless you are determined to wade through the
nightmare of i/o streams and its inpenetrable templates then you are better
off with C standard FILE's and printf/scanf.

>
> > #include "LSTM.h"
>
> The last time you posted this, you were reminded that it's quite
> impossible for anybody to help you if you don't cut your problem down
> so you can post a reproducible example.  You didn't do that: we still
> cannot know what is in that "LSTM.h" of yours.
>
> You're just annoying people, this way.  Please stop it.

It's quite simple, the first problem is in TLSTM::LoadPar()

  pFile->scan("NbPredictNextIn:");

pFile is an fstream* declared in TIOBase, as such it doesn't have a scan
method; you'll need to implement this.

The second error (LSTM1.cpp:45: using typedef-name `std::iostream' after
`class') is easily resolved by removing the word class from the call to
WriteWeightStream.

IMHO it's impenetrable error messages like these that should be a warning to
all that using STL streams can be an extremely unpleasant and protracted
business.  Caveat emptor, or in English, naff ;-)

-- Lawrence Rust, Software Systems, www.softsystem.co.uk

The problem with Windows XP: http://www.arachnoid.com/boycott


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019