Having looked around I've built a function that accepts a matrix and performs whatever it is I need on it, as follows:
float energycalc(float J, int **m, int row, int col){
...
}
Within the main the size of the array is defined and filled, however I cannot passs this to the function itself:
int matrix[row][col];
...
E=energycalc(J, matrix, row, col);
This results in a warning during compilation
"project.c:149: warning: passing argument 2 of ‘energycalc’ from incompatible pointer type project.c:53: note: expected ‘int **’ but argument is of type ‘int (*)[(long unsigned int)(col + -0x00000000000000001)]’
and leads to a segmentation fault.
Any help is greatly appreciated, thank you.