error array subscript is not an integer code example
Example 1: why a array are not int
int main() {
int[3] arr = { 11, 22, 33 };
}
Example 2: invalid types int int for array subscript c++
template<int numberOfRows, int numberOfColumns>
void printArray(int (&theArray)[numberOfRows][numberOfColumns])
{
for(int x = 0; x < numberOfRows; x++){
for(int y = 0; y < numberOfColumns; y++){
cout << theArray[x][y] << " ";
}
cout << endl;
}
}