I'm learning c++, I'm trying to display simple table with X Y coordinates in each case. But when I build it I get this error : error: no matching function for call to 'displayScreenXY'
I tried to replace
void displayScreenXY(int **tab, int x, int y);
by
void displayScreenXY(int tab[][], int x, int y);
but I get this error : error: array has incomplete element type 'int []' void displayScreenXY(int tab[][], int x, int y);
What I am missing ? Thanks for your help.
Zoltan
#include <iostream>
using namespace std;
#define xDiv 8
#define yDiv 6
void displayScreenXY(int **tab, int x, int y);
int main(){
int screenXY[yDiv][xDiv] = {0};
displayScreenXY(screenXY, xDiv, yDiv);
return 0;
}
void displayScreenXY(int **tab, int x, int y){
for (int j = 0; j < y; ++j){
for (int k = 0; k < x; ++k){
std::cout << j << k << " ";
}
std::cout << endl;
}
}