Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!elroy.jpl.nasa.gov!decwrl!stanford.edu!neon.Stanford.EDU!news From: philip@pescadero.stanford.edu (Philip Machanick) Newsgroups: comp.lang.c++ Subject: bug in istrstream example? Message-ID: <1991May11.015836.1556@neon.Stanford.EDU> Date: 11 May 91 01:58:36 GMT Sender: news@neon.Stanford.EDU (USENET News System) Organization: Computer Science Department, Stanford University Lines: 11 In both Lippman (p. 414) and the cfront 2.0 Library Manual (p 3.12) examples roughly of the form char s[] = "400" istrstream iss (s,sizeof(s)); appear. Presumably, sizeof is a bug (since this will always return the size of a pointer when applied to an array), and what is really required is strlen(s) - or should it be strlen(s)+1 to allow for the null char at the end? Has this been fixed in later editions / printings? Philip Machanick