+ 1
Fonction of some of two array 2D
Why no working every time is not display array that contains some of two array of two dimensions Is there is no way with using : int **somme(int **mat1,int **mat2,int nbLignes,int nbColonnes) for return array of two dimensions https://code.sololearn.com/c1mwI1PlusEQ/?ref=app
5 Respuestas
+ 2
Thank everyone i I found solution here if anyone wants to see
https://code.sololearn.com/cKq6StTP183q/?ref=app
+ 1
Martin Taylor
Is there is no way with using : int **somme(int **mat1,int **mat2,int nbLignes,int nbColonnes) for return array of two dimensions
+ 1
Martin Taylor
But solution that you give me it return array 1d in function but I want to return Matrix
+ 1
Martin Taylor
2d array of unknown size ??
but I give them *A[N][M] it mean that columns and rows is defined :
#define N 100
#define M 100
And same for C is defined
C= (int**)malloc(n * sizeof(int*));
for (i = 0; i < n; i++){
C[i] = (int*)malloc(m * sizeof(int));
}
n : number of columns that's user give
m : number of rows that's user give
+ 1
Martin Taylor
Does this is really necessary to free the memory like you did ??
Or you did this just to increase readability ??
Because program is going to end and close anyway. And allocated memory will be disallocated automatically.