www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2001/09/12/11:19:15

Message-ID: <3B9F7944.21FEDF6D@iolfree.ie>
From: Nino Matassa <nino AT iolfree DOT ie>
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>
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

<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
Nino Matassa wrote:
<blockquote TYPE=CITE>Hi,
<p>the code below can be copied/pasted/compiled and so on......
<br>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?
<br>Any help in understanding this is greatly appreciated.
<br>Thanks.
<br>N.
<p>I'm using gcc version 2.95.3 on Windows2000.
<p>**************************************************************************
<br>/* Exp.cpp */
<p>#include&lt;iostream>
<br>#include&lt;strstream>
<p>#define size 1024
<p>void main(void) {
<br>&nbsp;static char buffer[size];
<br>&nbsp;ostrstream os(buffer, size, ios::app);
<br>&nbsp;os &lt;&lt; "Hello World!" &lt;&lt; endl &lt;&lt; ends;
<br>&nbsp;cout &lt;&lt; os;
<br>}
<p>/*
<br>D:\root\Misc\source\C++>a
<br>0xffffffff
<br>*/
<br>**************************************************************************
<br>--
<br>Nino.
<p>Non illegitimes conturbabunt
<br>&nbsp;
<br>&nbsp;</blockquote>

<p><br>the last line "cout &lt;&lt; os;" should have read "cout &lt;&lt;
buffer;"
<br>Feeling sheepish!
<br>N.
<p>--
<br>Nino.
<p>Non illegitimes conturbabunt
<br>&nbsp;</html>

- Raw text -


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