"Victor Bazarov" <v.********@comAcast.netwrites:
Gary Wessle wrote:
Hi
I am getting a seg fault, only if I replace the "(*m_os[*i])" with
"cout" it prints. how can I fix this?
the example below given as a representation of the part of a larger
code which exebits the problem.
many thanks
class A
{
std::map<std::string, std::ofstream*m_os;
std::map<std::string, myTypet4s;
std::vector<stringfile_names;
public:
A(){}
void A_Mthd();
};
A::A()
{
void populate();
Instead of declaring a 'populate' function here you might want to
actually call it:
populate(); // drop the 'void'
And next time put a trace statements everywhere you need to verify
passing control through, or just use a debugger like everybody else
to confirm that the functions you need called actually get called.
actually, the function populate is being called from within the
ctor. I miss typed this part of the example.
trace statements? what is that, I put "cout <<" every where and that
is way I was able to narrow it down to the area mentioned at the start
of my original post.
I am not able to use the gdb debugger because I am not able to get it
working with this multi-threaded code.
I which I can do more, but I don't know what or how.
thanks