Wednesday, March 17, 2004

Re: ansi c++ revisited(by me)

MyClass x2 = new MyClass; // object created on heap

that won't work in C++, new returns the address of the object it created on the heap, so it will have to be
MyClass * x2 = new MyClass;
or
MyClass x2 = *(new Myclass);

dinesh.

No comments: