delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2003/01/07/13:22:37

Message-ID: <20030107170806.81785.qmail@web13003.mail.yahoo.com>
Date: Tue, 7 Jan 2003 09:08:06 -0800 (PST)
From: Thomas Tutone <thomas8675309 AT yahoo DOT com>
Subject: Re: scan() in c++
To: djgpp AT delorie DOT com
Cc: yc12 AT uow DOT edu DOT au
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com

"Y Chen" <yc12 AT uow DOT edu DOT au> wrote in message
news:<200301070806 DOT h07862v6014405 AT inti DOT its DOT uow DOT edu DOT au>...
> Dear Sir,
> 
> I got the following errors(The file is at the
bottom):
> 
> LSTM.cpp: In member function `virtual char
TLSTM::LoadPar()':
> LSTM.cpp:338: no matching function for call to
`std::basic_fstream<char, 
>    std::char_traits<char> >::scan(const char[17])'
> LSTM.cpp:343: no matching function for call to
`std::basic_fstream<char, 
>    std::char_traits<char> >::scan(const char[17])'

[Many more errors snipped.]

> How to fix the problem about "no matching
function..." and "using 
> typedef-name `std::iostream' after `class' "? Thanks
a lot for your 
> help.
> 
> Regards,
> Y Chen
> 

[Thousands on lines of code snipped.]

OK, you've violated two cardinal rules of asking for
help with your code.

1.  Post compilable code.  Here, you #include "LSTM.h"
and "Error.h", both of which are presumably header
files you wrote, but you haven't provided them. 
Without them, we can't compile your code, so it's not
particularly helpful to provide your .cpp file.

2.  Provide a short piece of compilable code that
duplicates the problem or error message.  By short, I
mean less than fifty lines.  Often, in the course of
reducing your code to the short sample, you are able
to figure out the error on your own.  Here, you've
listed what appears to be thousands of lines of code. 
How can we even find where your errors appeared, since
you don't provide line numbers?  And do you really
expect us to read all that?

But here are a few suggestions:

1.  Use standard headers.  You are using deprecated
headers, like <iostream.h>, when you should be using
standard headers, like <iostream>.  You'll have to add
"using namespace std;" after listing the header file
#includes.

2. Compile with warnings on.  When you compile your
program, turn on all warnings:

gxx -W -Wall -pedantic -o LSTM.exe LSTM.cpp

and don't ignore the warnings it gives you.

3. Provide a short code sample with the problem you
are having.  Make sure the code sample will compile in
the form you provide it - in other words, we must be
able to cut-and-paste your example, compile it, and
get the same error or problem you are having.

Good luck.

Best regards,

Tom

__________________________________________________
Do you Yahoo!?
Yahoo! News - Today's headlines
http://news.yahoo.com

- Raw text -


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