home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++
- Path: sparky!uunet!stanford.edu!lucid.com!lucid.com!jss
- From: jss@lucid.com (Jerry Schwarz)
- Subject: Re: strstream question
- Message-ID: <1992Aug18.211841.25068@lucid.com>
- Sender: usenet@lucid.com
- Reply-To: jss@lucid.com (Jerry Schwarz)
- Organization: Lucid, Inc.
- References: <1992Aug18.142928.14515@walter.bellcore.com>
- Date: Tue, 18 Aug 92 21:18:41 GMT
- Lines: 26
-
- In article <1992Aug18.142928.14515@walter.bellcore.com>, vidal@bae.bellcore.com (Vidal Graupera) writes:
- |> I want to change the string in an existing strstream.
- |> This is what I tried on a Sun using their 2.1 compiler:
- |>
- |> char p[100];
- |> ostrstream tstream(p, 100);
- |>
- |> // do some stuff with tstream
- |>
- |> char t[100];
- |> tstream.rdbuf()->setbuf(t,100);
- |>
- |> // tstream still uses p NOT t
- |>
-
- Can't be done. Setbuf is effective on strstreams only
- if you've used the default constructor and you haven't
- inserted anything into the strstream. If you check the
- return from setbuf you'll see it was NULL.
-
- -- Jerry Schwarz
-
-
-
-
-
-