1
0
mirror of https://gitlab.com/klmp200/LO27.git synced 2024-11-26 01:04:14 +00:00

corrigé free

This commit is contained in:
Naej 2016-12-27 22:26:06 +01:00
parent 0dfa280bfc
commit 98e08eab35
2 changed files with 16 additions and 9 deletions

View File

@ -83,7 +83,7 @@ bool CreateMatrixElem(Matrix matrix, int ColPos, int RowPos){
} else if (Col->data->rowIndex > RowPos){
elem->nextRow = Col->data;
Col->data = elem;
} else {
} else {NMWZxm5uQt
tmp = Col->data;
while (tmp->nextRow != NULL && tmp->nextRow->rowIndex < RowPos){
tmp=tmp->nextRow;
@ -295,18 +295,22 @@ bool RecursiveFreeCol(Matrix matrix, cellElement * elem){
Matrix freeMatrix(Matrix matrix){
ListElement * current = NULL;
int i = 0;
int j = 0;
printf("\n---FREE MATRIX---\n");
for (i=0;i<matrix.rowCount;i++){
for (j=0;j<matrix.colCount;j++){
SetCellValue(matrix,j,i,false);
matrix.colCount = 0;
matrix.rowCount = 0;
if (matrix.cols != NULL){
current= matrix.cols->head;
while (current != NULL){
RecursiveFreeCol(matrix,current->data);
current = current->next;
}
}
printf("---END OF MATRIX---\n\n");
FreeList(matrix.cols);
FreeList(matrix.rows);
return matrix;

3
main.c
View File

@ -34,6 +34,9 @@ int main(int argc, char **argv){
freeMatrix(m2);
m2 = rowSequenceOnMatrix(matrix, AND);
BasicPrintMatrix(m2);
/*sumMatrix(matrix,m2);*/
freeMatrix(m2);
freeMatrix(matrix);