Убрал утечку памяти

This commit is contained in:
AZEN-SGG 2024-11-27 19:02:11 +03:00
parent 673d0e250d
commit c6539e2868
4 changed files with 47 additions and 8 deletions

View file

@ -1,25 +1,29 @@
#include <stdio.h>
#include "seagwithsob.h"
#include "tools.h"
#include <stdlib.h>
#include "stdlib.h"
int main(void) {
FILE * file = getFile();
double * array;
double * orig_arr;
int length;
if (file == NULL) return -1;
array = getArray(file);
if (array == NULL) return -2;
length = (int)array[0] - 1;
orig_arr = array;
array = &array[1];
printArray(array, length);
sort(array, length);
printArray(array, length);
free(orig_arr);
printf("\n");
randomArray();
return 0;
}