delorie.com/archives/browse.cgi | search |
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<iostream> <br>#include<strstream> <p>#define size 1024 <p>void main(void) { <br> static char buffer[size]; <br> ostrstream os(buffer, size, ios::app); <br> os << "Hello World!" << endl << ends; <br> cout << os; <br>} <p>/* <br>D:\root\Misc\source\C++>a <br>0xffffffff <br>*/ <br>************************************************************************** <br>-- <br>Nino. <p>Non illegitimes conturbabunt <br> <br> </blockquote> <p><br>the last line "cout << os;" should have read "cout << buffer;" <br>Feeling sheepish! <br>N. <p>-- <br>Nino. <p>Non illegitimes conturbabunt <br> </html>
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |