Why doesn't

typedef [I]ClassName[/I] SomeName[[I]SomeSize[/I]][[I]SomeOtherSize[/I]];

work?

Recommended Answers

All 3 Replies

My mistake, poster below me is correct.

const int SomeSize = 5;
const int SomeOtherSize = 5;
class ClassName
{
};

typedef ClassName SomeName[SomeSize][SomeOtherSize];

Something else to consider :

template<typename T, int ROW, int COLUMN>
class Array2D{
private:
   T _array[ROW][COLUMN];
public:
 Array2D(){/*initialize _array*/}
 //Array2D methods/operations
};

int main(){
 Array2D<int,5,5> array;
}
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.