Mail Archives: djgpp/2002/11/14/17:53:04
"JMK" <jeffrey DOT m DOT klopotic AT lmco DOT nospam DOT com> wrote in
message news:<3DD421F6 DOT ED10A56A AT lmco DOT nospam DOT com>...
>There's something wrong with the compiler setup.
I don't think so.
>Unless redefining output functions, there should be
>no reason to scope a
>global function like cout in so simple a program.
You are incorrect. It doesn't matter whether the
program is simple or complex, you can't reference
"cout" without qualifying it as "std::cout", adding a
"using std::cout;" declaration, or (least desirably)
throwing in "using namespace std;".
>I've witnessed a difference on certain other
>compilers between
>iostream.h and iostream, but gcc 2.95.3 didn't have
>it.
Yes, that's because gcc 2.95.3 was not
Standard-conforming in this respect. Fortunately, gcc
3.2 does conform much more closely to the Standard.
>Try using
>#include<iostream.h>
>instead of just
>#include<iostream>
>and see if that works.
Don't do this. <iostream.h> is not part of the
Standard. If you compile this with warnings turned
on, you'll get a warning for doing this, and that
warning is there for a very good reason. It's also a
very bad habit to get into. <iostream.h> is
deprecated on gcc (and most other compilers), which
means it may not work at all on future releases. Use
<iostream> and make the fixes I previously indicated.
Best regards,
Tom
__________________________________________________
Do you Yahoo!?
Yahoo! News - Today's headlines
http://news.yahoo.com
- Raw text -