delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2003/02/10/06:30:18

From: "Lawrence Rust" <lvr AT 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> <qMvZ9.6040$RZ DOT 55713 AT newsfep4-win DOT server DOT ntli DOT net> <9ec55012 DOT 0302092152 DOT 7b1b20f AT posting DOT google DOT com>
Subject: Re: scan() in c++
Lines: 39
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: <JTL1a.1679$HO.11911@newsfep4-glfd.server.ntli.net>
Date: Mon, 10 Feb 2003 11:17:56 -0000
NNTP-Posting-Host: 62.253.142.146
X-Complaints-To: abuse AT ntlworld DOT com
X-Trace: newsfep4-glfd.server.ntli.net 1044875881 62.253.142.146 (Mon, 10 Feb 2003 11:18:01 GMT)
NNTP-Posting-Date: Mon, 10 Feb 2003 11:18:01 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

"yc" wrote...
> I find the following sentence in fstream.h
>     class fstream : public fstreambase, public iostream {
>
> and
>
>     class iostream : public istream, public ostream
>     istream& scan(const char *format ...);
> in iostream.h,
>
>
> and
> TIOBase::TIOBase() {
>   pFile = new fstream();
> }
> in IOBase.cpp.
>
> The scan method seems existing. How to implement it? And need I
> include IOBase.cpp when compiling LSTM.cpp?

The C++ I/O stream library was extensively modified during the ANSI
standards process with the result that functions like istream::scan were not
included.  Most compilers, including gcc, offer some form of backwards
compatibility but there are significant limitations.  NB you should not use
old .h C++ library headers in new programs as these were deprecated with the
release of ISO 14882.

Consequently you will need to implement your own function that replaces
istream::scan.  Typically this can be done with the standard formatted input
operations like >>, get and getline.

HTH

-- 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