Re: Outputing to screen..

Shamez Firoz Rajan (sfrajan@sfu.ca)
Thu, 2 Apr 1998 17:34:57 -0800 (PST)


Where does it display ? 

It displays to the ostream you pass (cout in this case) - so now instead
of passing cout, you pass the instance of ostrstream that will store the
output as a string.....get it ?? 



    ================================================================
                             Shamez Rajan
              Computing Science, Simon Fraser University
       sfrajan@sfu.ca, shamez@cnx.net, http://www.cnx.net/~shamez

           "Object Oriented Programming - Cheerfully Accepted"
    ================================================================

On Thu, 2 Apr 1998, Todd Zuccolo wrote:

> What string are you talking about? Display () displays the expression tree
> of objects we build with parse, not a string.
> 
> >Have an instance of ostrstream; pass it as the parameter to display - this
> >instance will store the string - it has a function str() that will return
> >a pointer to that string, and another function pcount() that will return
> >length of the string - hope this helps !! 
> >
> >Oh yah - make sure you include <strstrea.h>
> >
> >    ================================================================
> >                             Shamez Rajan
> >              Computing Science, Simon Fraser University
> >       sfrajan@sfu.ca, shamez@cnx.net, http://www.cnx.net/~shamez
> >
> >           "Object Oriented Programming - Cheerfully Accepted"
> >    ================================================================
> >
> >On Wed, 1 Apr 1998, Andrew Pojar wrote:
> >
> >> > Hi 
> >> > Could somebody please give me a hint as to how am I 
> >> > supposed to output to the screen using display(ostream &)???
> >> > 
> >> > Am I supposed to convert ostream into a string, so that TextOut can output
> >> > that?? 
> >> > Thanks a lot. 
> >> >  
> >> 
> >> Hi 
> >> 
> >> I was wondering if you got an answer to your question. If so I would love
> >> to see it. Thanks
> >> 
> >> Andrew
> >> 
> >> 
> >> 
> >
> >
> >
> 
>