Message-ID: <3B9F7944.21FEDF6D@iolfree.ie> From: Nino Matassa X-Mailer: Mozilla 4.7 [en] (WinNT; U) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: comp.os.msdos.djgpp Subject: Yep! See my mistake. Ignore this one thanks. References: <3B9F74B4 DOT 467A3C5C AT iolfree DOT ie> Content-Type: text/html; charset=us-ascii Content-Transfer-Encoding: 7bit Lines: 43 Date: Wed, 12 Sep 2001 15:03:29 GMT NNTP-Posting-Host: 194.128.43.122 X-Complaints-To: abuse AT iol DOT ie X-Trace: news.iol.ie 1000307009 194.128.43.122 (Wed, 12 Sep 2001 16:03:29 BST) NNTP-Posting-Date: Wed, 12 Sep 2001 16:03:29 BST Organization: Ireland On-Line Customer To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Nino Matassa wrote:
Hi,

the code below can be copied/pasted/compiled and so on......
The commented out section at the end is its output. Not what I expected. I'm running djgpp under Windows 2000 if that has any relevance. Do you have any idea why this code code produces that output?
Any help in understanding this is greatly appreciated.
Thanks.
N.

I'm using gcc version 2.95.3 on Windows2000.

**************************************************************************
/* Exp.cpp */

#include<iostream>
#include<strstream>

#define size 1024

void main(void) {
 static char buffer[size];
 ostrstream os(buffer, size, ios::app);
 os << "Hello World!" << endl << ends;
 cout << os;
}

/*
D:\root\Misc\source\C++>a
0xffffffff
*/
**************************************************************************
--
Nino.

Non illegitimes conturbabunt
 
 


the last line "cout << os;" should have read "cout << buffer;"
Feeling sheepish!
N.

--
Nino.

Non illegitimes conturbabunt