Using Iostream Classes for Formatted Input
Example 6 shows how to use the iostream classes for formatted input.
Example 6 – Using iostream classes for formatted input
// set up the RWPortal object, portal
 
RWPortalIStream istrm(portal); //1
RWCString s;
istrm >> s; //2
//1 Sets up an istream object that uses the RWPortal object portal for its source of bytes. The RWPortalIStream also makes its own copy of the portal, which enables you to specify a temporary object in the constructor.
//2 Inputs objects using the stream. Because the RWPortalIStream class is derived from istream, any objects that can be extracted from an istream can also be extracted from an RWPortalIStream.