B
BCC
Hi,
If I have something like this:
CMyClass* p1;
CMyClass* p2;
I know I can do:
p1 = new CMyClass();
p2 = p1;
Now both my pointers point to the same object. Cool so far.
But is it possible to do this -before- you initialize your pointers?
p2 = p1;
p1 = new CMyClass();
and have both pointers point to the same object?
I don't think so, but thought I'd check for sure.
Thanks,
Bryan
If I have something like this:
CMyClass* p1;
CMyClass* p2;
I know I can do:
p1 = new CMyClass();
p2 = p1;
Now both my pointers point to the same object. Cool so far.
But is it possible to do this -before- you initialize your pointers?
p2 = p1;
p1 = new CMyClass();
and have both pointers point to the same object?
I don't think so, but thought I'd check for sure.
Thanks,
Bryan