I've been working on a C++ project for school and I've encountered some problems when it comes to 2D arrays of objects. So I have the following class:
void do_stuff(MyClass M);
Try the following
const MyClass ( * myMagicMethod() ) const;
typedef const MyClass ( *A ); //... A myMagicMethod() const;
The qualifier const is used if you do not want that the array would be changed in a method of other class.
Another approach is to pass the array by reference. For example
const MyClass ( & myMagicMethod() ) const;
typedef MyClass ( &A ); //... const A myMagicMethod() const;
In the method that will process the array the parameter also must be declared like reference.