Fonction of some of two array 2D | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 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

1st Nov 2021, 10:21 PM
HICHAM
5 Answers
+ 2
Thank everyone i I found solution here if anyone wants to see https://code.sololearn.com/cKq6StTP183q/?ref=app
2nd Nov 2021, 9:34 PM
HICHAM
+ 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
2nd Nov 2021, 5:56 AM
HICHAM
+ 1
Martin Taylor But solution that you give me it return array 1d in function but I want to return Matrix
2nd Nov 2021, 2:22 PM
HICHAM
+ 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
2nd Nov 2021, 4:43 PM
HICHAM
+ 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.
2nd Nov 2021, 4:44 PM
🌀 Shail Murtaza شعیل مرتضیٰ
🌀 Shail Murtaza شعیل مرتضیٰ - avatar