From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24198 invoked by alias); 28 Oct 2002 11:07:02 -0000 Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org Received: (qmail 24032 invoked from network); 28 Oct 2002 11:06:59 -0000 Received: from unknown (HELO postino.fi.infn.it) (192.84.145.9) by sources.redhat.com with SMTP; 28 Oct 2002 11:06:59 -0000 Received: from pc213-02.inwind.it (pc213-02.fi.infn.it [193.206.190.187]) by postino.fi.infn.it (8.12.6/8.12.6) with ESMTP id g9SB6sIt005368; Mon, 28 Oct 2002 12:06:56 +0100 (CET) Message-Id: <5.1.1.6.2.20021028120404.00b5e8d8@popmail.libero.it> X-Sender: fwyzard-gcc@libero.it@popmail.libero.it Date: Mon, 28 Oct 2002 03:07:00 -0000 To: "Jessee, Mark" From: Andrea Bocci Subject: RE: Problems with stringstream Cc: "'Moore, Mathew L'" , "Jessee, Mark" , "'gcc-help@gcc.gnu.org'" In-Reply-To: <83E3831A88E65844B01DB1A73FB66F93023BBBAC@CSDNT99.cdcgy.com > Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed X-RAVMilter-Version: 8.3.1(snapshot 20020109) (postino.fi.infn.it) X-Spam-Status: No, hits=-3.4 required=6.5 tests=IN_REP_TO version=2.31 X-SW-Source: 2002-10/txt/msg00339.txt.bz2 At 10.48 25/10/2002 -0600, Jessee, Mark wrote: >Matt, > >Your example fails as well. But I found if I modify it a bit (see below), >it works fine. Still not sure why though. Thoughts? Something to do with >flushing the stream? I guess you're right. Probably the standard out is not automatially flushed at the end of the program, so you don't get the last output. Does this... #include #include #include using namespace std; int main () { stringstream oss; string mystr; oss << "Sample string"; mystr=oss.str(); cout << mystr << endl; // flushes stdout return 0; } ...work ? fwyzard