problem passing 2d array to a function - please see code

// P L E A S E H E L P !
// what must I do to call function getFeedingData and pass it
// array feedingData?


#include <iostream>
#include <iomanip>
#include <string>

using namespace std;

const int ROWS = 3;
const int COLS = 6;

string monkeyNames[ROWS] = { "Larry", "Moe", "Curly" };

// prototypes
void getFeedingData(double[ ][COLS], const int);


int main()
{
// declare arrays
double feedingData[ROWS][COLS] = { {9.2,3.6,10.8}, {12.6, 3.2, 4.7} };

// call functions
getFeedingData(feedingData[ROWS][COLS], ROWS);


return 0;
}


// define function
void getFeedingData(double array[ROWS][COLS], const int COLS)
{
cout << "inside function getFeedingData\n";
}
1
2
// call functions
getFeedingData(feedingData[ROWS][COLS], ROWS);

to
1
2
// call functions
getFeedingData(feedingData, ROWS);
Thank you much
Topic archived. No new replies allowed.