std::istrstream::istrstream (3) - Linux Manuals
std::istrstream::istrstream: std::istrstream::istrstream
NAME
std::istrstream::istrstream - std::istrstream::istrstream
Synopsis
explicit istrstream(const char* s); (1)
explicit istrstream(char* s); (2)
istrstream(const char* s, std::streamsize n); (3)
istrstream(char* s, std::streamsize n); (4)
Constructs new istrstream and its underlying std::strstreambuf.
1,2) Constructs the underlying std::strstreambuf by calling strstreambuf(s,0) and initializes the base class with the address of the strstreambuf. The behavior is undefined if s is not pointing at an element of a null-terminated array.
3,4) Constructs the underlying std::strstreambuf by calling strstreambuf(s,n) and initializes the base class with the address of the strstreambuf. The behavior is undefined if s is not pointing at an element of an array whose length is at least n elements.
Parameters
s - C-string or char array to use as the contents of the stream
n - size of the array
Example
// Run this code
Output:
See also
constructor (public member function of std::strstreambuf)
constructor (public member function of std::ostrstream)
constructor (public member function of std::strstream)