Well, I tried, but I'm completely baffled as to why this doesn't work (note the strange error, which is in a comment above the line it occurs at):
template<class T>
class IArrayHolder{
public:
virtual T GetVal(int x, int y) = 0;
};
template<class T, class S>
class ArrayHolder: public IArrayHolder<S>
{
private:
T multiArray;
public:
ArrayHolder(T val){
multiArray = val;
}
S GetVal(int x, int y){
return multiArray[x][y];
};
};
System::Void SomeFunction(){
int x[10][20];
int y[20][30];
IArrayHolder<int> * xInterface;
xInterface = new ArrayHolder<int[][20], int>(x);
IArrayHolder<int> * yInterface;
yInterface = new ArrayHolder<int[][30], int>(y);
};
System::Void AnotherFunction(IArrayHolder<int> * arrayHolder){
int val = arrayHolder->GetVal(20, 20);
};
You figure out that error, and you've go your solution. If not, perhaps you should just copy the array values to a 2D vector and use that instead. Also, I don't have much experience with void pointers, but they can apparently point to the address of anything, so you might try working with those.