Thursday, September 18, 2008

What are proxy objects? - c++ interview question with solution

What are proxy objects? 
Objects that stand for other objects are called proxy objects or surrogates. 
template 

class Array2D
{
public:
class Array1D
{
public:
T& operator[] (int index);
const T& operator[] (int index)const;
};

Array1D operator[] (int index);
const Array1D operator[] (int index) const;
};

The following then becomes legal:

Array2D
data(10,20);
cout<

No comments:

Post a Comment

Thanks to given comments.......

My Blog List