I'm trying to create a static 2-d array via passing in to the function, where I specify n
number of records and then read it. Need to use pointers.
#define NMAX 100
void CreateStatic(int* matrix, int* n);
int main() {
// int num;
int matrix[NMAX][NMAX], n;
CreateStatic(*matrix, &n);
}
void CreateStatic(int* matrix, int* n) {
scanf("%d", n)
for (int i = 0; i < *n; i++) {
for (int j = 0; j < *n; j++) {
scanf("%d", a);
}
}
}
What should I write instead of a
to make it work?
Do I pass a correct type into the function? (*matrix, int * matrix)