delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2002/12/06/07:15:14

From: Hans-Bernhard Broeker <broeker AT physik DOT rwth-aachen DOT de>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: About using <iostream> instead of <iostream.h>
Date: 6 Dec 2002 12:14:48 GMT
Organization: Aachen University of Technology (RWTH)
Lines: 31
Message-ID: <asq4bo$i2v$1@nets3.rz.RWTH-Aachen.DE>
References: <1039127235030502 AT lycos-europe DOT com>
NNTP-Posting-Host: acp3bf.physik.rwth-aachen.de
X-Trace: nets3.rz.RWTH-Aachen.DE 1039176888 18527 137.226.32.75 (6 Dec 2002 12:14:48 GMT)
X-Complaints-To: abuse AT rwth-aachen DOT de
NNTP-Posting-Date: 6 Dec 2002 12:14:48 GMT
Originator: broeker@
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Adam * <adtom AT spray DOT se> wrote:

[Please, next time, try to break your message into lines of reasonable
length --- the entire paragraph below was sent as a single, long line.]

> I just got used to working with <iostream>, writing "using
> std::cout, using std::endl, using std::cin etc.". I havent worked
> with c++ so much, but personally i think it was easier just having
> to write <iostream.h>. Why is it changed?

You're asking the wrong audience.  This is a decision made by the ISO
C++ standardization committee.  You may not like it, but you'll have
to live with it anyway.  DJGPP has nothing to do with it.

> unimportant, but I just wonder what the purpose is using this new
> standard. Is it for making the *.exe file smaller or something?

No. It's for reducing what computer scientists would call "namespace
pollution".  The idea is to avoid programs inadvertantly using names
that the standard library already is using for itself, which can cause
all kinds of very weird errors.  The classic example is in C on Unix,
concerning the inconspicious variable name 'index'.  If ever you use a
variable of this name, with external linkage, your program will begin
to behave very strangely, because you've now overridden a Unix C
library function of the same name with your variable.  Scores of
programmers have fallen over this.


-- 
Hans-Bernhard Broeker (broeker AT physik DOT rwth-aachen DOT de)
Even if all the snow were burnt, ashes would remain.

- Raw text -


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