delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2002/11/14/17:53:04

Message-ID: <20021114225250.29569.qmail@web13001.mail.yahoo.com>
Date: Thu, 14 Nov 2002 14:52:50 -0800 (PST)
From: Thomas Tutone <thomas8675309 AT yahoo DOT com>
Subject: Re: Re: whats wrong with my compiler
To: djgpp AT delorie DOT com
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com

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


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