Depending on your needs and knowledge something along these lines might work. This is only a rough outline of one possible way to proceed. If it looks like something that might suffice, it's up to you to fill in the details.
template <T> //use templated class for a general case class
class DblSSA
{
T ** internalArray; //declare size of internalArray using dynamic memory in constructor
int r;
int c;
.
.
.
}
class IntDblSSSA //int specialization of prior template class
{
DblSSSa <int> idsa; //object of templated class only allowing int as type
.
.
.
int sumOfArrayElements() //find sum of all elements
{
int sum = 0; //initialize variable to zero
for each row
for each col
sum += given element of idsa.internalArray
return sum
}
}
int main()
IntDblSSSA idsssa; //declare an object of desired type
int result = idsssa.sumOfArrayElements()
cout << result