For this assignment, my professor gave us the following function header:
void thisFunc(Node** root, const int * elements[], const int count)
Presumably, this is correct and I cannot change this.
Const int *elements is an array of int values taken with scanf; I declared mine with
int entries[atoi(argv[1])-1];
and successfully populated it with
for(int a=0; a < atoi(argv[1]); a++) {
scanf("%i", &entries[a]);
}
but I'm struggling with calling thisFunc.
thisFunc(&bst, entries, atoi(argv[1]));
which throws the obvious error:
note: expected 'const int **' but argument is of type 'int *'
It's expecting a constant array of pointers to pointers of ints, if I'm right? What should I be doing with my entries array that will make it a valid parameter?
I've tried passing entries in by reference (&entries), but I'm a little lost.