Mail Archives: djgpp/1998/05/09/14:30:37
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 -