I am trying to create a pointer to the start of a matrix to pass into a function as an argument. Here’s what I have:
int **p;
p = &(&matrix[0][0]);
func(p);
In doing this though I get the error “lvalue required as unary ‘&’ operand.” I’m guessing it’s just an issue of me not having the right syntax, but maybe not. Any help would be greatly appreciated.
Well,
matrix[0]points to the start of the matrix (although itself is not a pointer, but an array). So the following should do it: