home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / lang / cplus / 12500 < prev    next >
Encoding:
Text File  |  1992-08-18  |  701 b   |  33 lines

  1. Newsgroups: comp.lang.c++
  2. Path: sparky!uunet!walter!plate!vidal
  3. From: vidal@bae.bellcore.com (Vidal Graupera)
  4. Subject: strstream question
  5. Message-ID: <1992Aug18.142928.14515@walter.bellcore.com>
  6. Sender: vidal@plate (Vidal Graupera)
  7. Nntp-Posting-Host: plate.bae.bellcore.com
  8. Organization: Bellcore
  9. Date: Tue, 18 Aug 92 14:29:28 GMT
  10. Lines: 21
  11.  
  12. I want to change the string in an existing strstream. 
  13. This is what I tried on a Sun using their 2.1 compiler:
  14.  
  15.   char p[100];
  16.   ostrstream tstream(p, 100);
  17.  
  18.   // do some stuff with tstream
  19.  
  20.   char t[100];
  21.   tstream.rdbuf()->setbuf(t,100);
  22.  
  23.   // tstream still uses p NOT t
  24.  
  25. Any help much appreciated.
  26.  
  27. Vidal Graupera
  28. Bellcore
  29.  
  30. email: vidal@bae.bellcore.com
  31.  
  32.  
  33.