0
 #include <iostream>
using namespace std;
int ROWS = 3;
int COLS = 4;

How do I solve this c++ multidimensionalArray problem? I have been working on this for some time but I just cant figiure it out, thank you verry much

void fillScores(int [ROWS][COLS]);

int main() {
    int scores[ROWS][COLS] = {{1, 2, 3, 4}, {5, 6, 7, 8}, {9, 10, 11, 12}};
    fillScores(scores);
    return 0;
}

void fillScores(int newScores[ROWS][COLS]) {
    cout << newScores[1][1]<<endl;
}

1 Answers1

0

You can wrap the array in a struct and then pass it by address, where you need.

struct ArrayWrapper
{
   int _arr[ROWS][COLS];
};
vordhosbn
  • 332
  • 5
  • 16