From: "D. Vrabel" Newsgroups: comp.os.msdos.djgpp Subject: Re: strstream str() problem Date: Mon, 26 Oct 1998 15:33:08 +0000 Organization: University of Cambridge, England Lines: 14 Message-ID: References: NNTP-Posting-Host: punch.eng.cam.ac.uk Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Sender: dv207 AT punch DOT eng DOT cam DOT ac DOT uk In-Reply-To: To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com On Mon, 26 Oct 1998 Koen_Van_Herck AT xircom DOT com wrote: > It seems the str() function [in strstream] does > not append the '\0' terminator to the string correctly. Is this a bug, or > am I doing something wrong ? The behavior you are experiencing is the correct one. You must terminate your strings with the ends manipulator eg: strstream s; s << "Testing, testing" << ends; string str=s.str(); Dave.