delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/05/09/14:30:37

From: "John M. Aldrich" <fighteer AT cs DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: djgpp daily digest for 05 May 1998 2/3
Date: Sat, 09 May 1998 14:23:06 -0400
Organization: Two pounds of chaos and a pinch of salt.
Lines: 54
Message-ID: <35549F0A.692C@cs.com>
References: <199805091800 DOT SAA03444 AT brethil DOT esoterica DOT pt>
NNTP-Posting-Host: ppp112.cs.net
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

David Leal wrote:
> 
> void mostra( Tabuleiro tab1 ) { // show game
>      cout << ' ' << tab1[0][0] << ' ' << '|' << ' ' << tab1[0][1]
>             << ' ' << '|' << ' ' << tab1[0][2] << endl; cout << setw(11)
>             << setfill('-') << endl;
>      cout << ' ' << tab1[1][0] << ' ' << '|' << ' ' << tab1[1][1]
>             << ' ' << '|' << ' ' << tab1[1][2] << endl;     cout << setw(11)
>             << setfill('-') << endl;
>       cout << ' ' <<     tab1[2][0] << ' ' << '|' << ' '
>              << tab1[2][1] << ' ' << '|' << '     ' << tab1[2][2] << endl;
> }
> 
>         This has nothing to do with rhide, because I compiled usind gpp
> outside rhide and it happened, too.
>         I used '-O2' and '-s'.
> 
>         The only thing rhide does is getting I-don't-know-what because it
> always displays "bad command or file name" in the messages window.
> However the programs always compiled fine...
>         Any sugestion?

This is just an incompatibility between the Borland iostream and DJGPP
iostream libraries.  If you change the code as follows, it works for me:

void mostra( Tabuleiro tab1 ) { // show game
     cout << ' ' << tab1[0][0] << ' ' << '|' << ' ' << tab1[0][1]
            << ' ' << '|' << ' ' << tab1[0][2] << endl; cout << setw(11)
            << setfill('-') << "" << endl;
     cout << ' ' << tab1[1][0] << ' ' << '|' << ' ' << tab1[1][1]
            << ' ' << '|' << ' ' << tab1[1][2] << endl;     cout <<
setw(11)
            << setfill('-') << "" << endl;
      cout << ' ' <<     tab1[2][0] << ' ' << '|' << ' '
             << tab1[2][1] << ' ' << '|' << ' ' << tab1[2][2] << endl;
}

I'm not sure if the current C++ standard defines behavior when
displaying manipulators like endl.  If it does, then this is a bug in
the DJGPP iostream and should be fixed.  If not, you'll just have to
live with it.  I should, however, note that Borland is not well known
for compatibility with standards.

-- 
John M. Aldrich <fighteer AT cs DOT com> - ICQ UIN# 7406319

* Anything that happens, happens.
* Anything that, in happening, causes something else to happen,
  causes something else to happen.
* Anything that, in happening, causes itself to happen again, happens
  again.
* It doesn't necessarily do it in chronological order, though.
 
                                       --- Douglas Adams

- Raw text -


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