(ref.doc)clamage 230395

Next minsky 040495 Prev: bs 010495 Up: Usenet

Newsgroups: comp.lang.c++
Subject: Re: ostrstream::str()
Date: 23 Mar 1995 21:08:47 GMT

In article 95Mar22145007@ventures, kcline@ventures (Kevin Cline) writes:
>What should the following function return, a pointer to a null byte,
>or the null pointer?
>
>#include <strstream.h>
>char *f() {
>	ostrstream ost;
>	return ost.str();
>}
>
>Sun C++ 4.0.1 returns a null pointer.  Is that a bug?
>What does the proposed standard say?

The draft standard has dropped strstreams in favor of stringstreams,
but the last version of the draft which contained strstreams said
explicitly that str() might return a null pointer.

The original Cfront documentation did not specify what should happen
in this case, but the Cfront implementation also returned a null pointer.

automatically generated by info2www version 1.2.2.8