Mail Archives: djgpp/2002/12/06/07:15:14
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 -