$include_dir="/home/hyper-archives/boost-users/include"; include("$include_dir/msg-header.inc") ?>
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2008-05-21 09:34:47
AMDG
Meir Yanovich wrote:
> typedef boost::shared_ptr<std::ofstream> OFStreamPtrType;
>
> class Foo {
> static OFStreamPtrType iStream;
> }
>
> then in the cpp file :
>
> OFStreamPtrType Utilities::iStream(new ofstream("mylog.txt",ios::app));
> Foo::printLog(string s){
> if (Foo::iStream->is_open())
> {
> Foo::iStream << c <<".\n";
> }
> }
>
> no its opening the file mylog.txt but it is not writing any thing to it
> why ?
It might help to dereference the pointer.
*Foo::iStream << c <<".\n";
In Christ,
Steven Watanabe