I want to initialize a n*n square matrix to later pass it by reference into another function. But it doesn't even compile. I've tried everything, please help.
#include<stdlib.h>
int main()
{
int i, j, n = 3;
float **a;
a = malloc(n * sizeof (float **));//Here I try to create the n pointers to pointer to float for the rows
for(i = 1;i <= n;i++){
a[i] = malloc(n * sizeof(float *)); //Here I try to create the n * n pointers to float for the columns
for(j = 1;j <= n;j++)
*(*(a + i - 1) + j - 1) = malloc(sizeof(float)); //Here I try to free the space for the elements
return 0;
}