int **A = (int **)malloc(N * sizeof(int*)); for(i=0; i<N; i++){ A[i] = (int *)malloc(N * sizeof(int)); }