Hi,
I am using VC++6, MFC Application
I am having the member variable - CArray < Coordinates, Coordinates & > mCoordinates. Coordinates is a structure, contains x, y, and z. When i return reference to this object, there is no problem. but When i assign to some reference i get problem.
The Code is
struct Coordinates{
int x, y, z;
};
class A{
private:
CArray < Coordinates, Coordinates & > mCoordinates
public: CArray < Coordinates, Coordinates & > & GetCoordinates() {
return mCoordinates;
}
};
class B {
public:
void Print () {
A objA;
CArray < Coordinates, Coordinates & > &ref = objA.GetCoordinates ();
}
}
In Class B's Print () function, i am getting problem when assign the coordinates. Compiler says different level of indirection. Anyone suggest me how to solve this.