Error output: invalid conversion from 'int (*) [3]' to 'int' [-fpermissive]
What is the meaning of this error?
And if you declare a function without a prototype, then everything is fine.

#include <iostream> #include <conio.h> using namespace std; //вывод элементов двумерного массива в консоль void outputArray (int); int main(){ int arrayTest [3][3] = { {0, 0, 0}, {0, 0, 0}, {0, 0, 0} }; outputArray (arrayTest); // На этой строке метка об ошибке return 0; } void outputArray (int arr[][3]){ for (int i = 0; i < 3; i++) { for (int j = 0; j < 3; j++) { cout << arr[i][j]; } cout << endl; } } 

    1 answer 1

    You have the first prototype ad:

     void outputArray (int); 

    does not coincide with the second definition, which should give the body:

     void outputArray (int arr[][3]){ for (int i = 0; i < 3; i++) { for (int j = 0; j < 3; j++) { cout << arr[i][j]; } cout << endl; } } 

    For the compiler to understand you, the headers of the prototype and the implementation must be the same - there must be

     void outputArray (int arr[][3]);