I have a problem in some code I've been writing lately.
Suppose I have the following code:
Then at some point inside a function of class B I do:Code:class A{ public: Vector3D* point; }; class B{ public: A* obj; float computeSomething( Vector3D* point ); }; float B::computeSomething( Vector3D* point ){ Vector3D* v = someObject->getVector(); float result = *point * *v; return result; }
My problem is, pointer obj is correctly initialized before the call to function computeSomething, meaning that it points to an instance of class A, but after the function call the pointer is NULL!Code:float m = computeSomething( obj->point );
It seems that somhow the instance of class A gets erased.
Does someone know why?
Ed.



LinkBack URL
About LinkBacks


