Re: C++ question

From: Franco Gasperino (awe@CET.COM)
Date: 08/06/97


Why not just send the string you want to some object like:

class CLog
{
public:
 CLog();
 ~CLog();
 void Log_Some_Data(char *string);
};

Then have a file descriptor useable for the actual log file. Test to see
if it exits, then find the EOF, then start adding there.

                       Franco Gasperino
                       Cutting Edge Communications, Inc.
                       509-444-INET
                       awe@cet.com

On Wed, 6 Aug 1997, Michael J. McGillick wrote:

> Hello All:
>
> In the source code, I know that there are lines similar to:
>
>     sprintf(buf, "Running game on port %d.", port);
>     log(buf);
>
> I do understand that the purpose of this is to build a string in buf, and
> then send it to the log function.  I'm currently working on porting the
> code to C++, and was wondering if anyone new of the corresponding C++
> equivalent to writing a stream to a buffer.  With the normal cout and cerr
> commands, the string is written out to screen immediately, insted of being
> stored in a buffer.
>
> I apologize if this is a stretch for an appropriate question for this
> list.  Thanks for any help.
>
> - Mike
>
>
>      +------------------------------------------------------------+
>      | Ensure that you have read the CircleMUD Mailing List FAQ:  |
>      | http://democracy.queensu.ca/~fletcher/Circle/list-faq.html |
>      +------------------------------------------------------------+
>


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     | http://democracy.queensu.ca/~fletcher/Circle/list-faq.html |
     +------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/08/00 PST