From: Erik Max Francis Newsgroups: comp.os.msdos.djgpp Subject: Re: strstream str() problem Date: Thu, 29 Oct 1998 13:05:46 -0800 Organization: Alcyone Systems Lines: 23 Message-ID: <3638D8AA.2D43A06@alcyone.com> References: NNTP-Posting-Host: charmaine.alcyone.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 3.01 (X11; I; Linux 2.0.34 i686) To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Koen_Van_Herck AT xircom DOT com wrote: > The following code ... > fails to properly terminate the string s. (output is "test > first\ngarbagegarbage...test\ngarbage..." It seems the str() function > does > not append the '\0' terminator to the string correctly. Is this a bug, > or > am I doing something wrong ? You need to terminate it yourself, with os << ends; -- Erik Max Francis / email max AT alcyone DOT com / whois mf303 / icq 16063900 Alcyone Systems / irc maxxon (efnet) / finger max AT sade DOT alcyone DOT com San Jose, CA / languages En, Eo / web http://www.alcyone.com/max/ USA / icbm 37 20 07 N 121 53 38 W / &tSftDotIotE \ / The believer is happy; the doubter is wise. / (an Hungarian proverb)