C++ question

Chris Johns cmj at fluffles.freeserve.co.uk
Mon Feb 11 02:15:21 PST 2002

> Apart from this example, GCC works fine for me.  What's wrong here?

You need an operator = for the line

 p = k; 

to work.

or you'll end up with name in both pointing to the same memory. the
destruction of p will free this, the destruction of k will then attempt
to free it again, and result in the abort.
Chris Johns (cmj at fluffles.freeserve.co.uk)

More information about the gcc mailing list