delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2003/01/28/09:20:20

From: Richard Dawe <rich AT phekda DOT freeserve DOT co DOT uk>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: scan() in c++
Date: Tue, 28 Jan 2003 13:59:10 +0000
Lines: 39
Message-ID: <3E368CAE.3F4AD13@phekda.freeserve.co.uk>
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>
NNTP-Posting-Host: 62.136.47.115
Mime-Version: 1.0
X-Trace: newsg3.svr.pol.co.uk 1043762575 10495 62.136.47.115 (28 Jan 2003 14:02:55 GMT)
NNTP-Posting-Date: 28 Jan 2003 14:02:55 GMT
X-Complaints-To: abuse AT theplanet DOT net
X-Mailer: Mozilla 4.77 [en] (X11; U; Linux 2.2.23 i586)
X-Accept-Language: de,fr
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Hello.

Lawrence Rust wrote:
> 
> "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.
[snip]

There are right and wrong ways of including stdio in C++ programs. The wrong
way is <stdio.h>. The right way is <cstdio>. This is what Hans-Bernhard means,
I think.

Regards,

-- 
Richard Dawe [ http://www.phekda.freeserve.co.uk/richdawe/ ]

- Raw text -


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