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:
class mecanice
{
public:
mecanice();
~mecanice();
...
protected:
private:
...
MyClass Ob[8][8];
};
And I need a method that will return Ob so that I can use it in a method from some other class that will do stuff based on what's in Ob:
class doodle
{
public:
doodle();
~doodle();
void do_stuff(MyClass M[8][8]);
...
protected:
private:
...
};
I've tried all kinds ways of going about it but all of them ended up with compiling errors usually related to pointers. Is there any way to do this?
typedef MyClass MyClassArray[8][8];and returningObas aMyClassArray?std::vector