update gitignore + solve printArrayData issue

This commit is contained in:
quentin.perret 2022-09-06 16:44:13 +02:00
parent c91ba029e2
commit 83a308bb96
4 changed files with 5 additions and 23 deletions

2
.gitignore vendored
View file

@ -2,6 +2,8 @@
*.png *.png
*.exe *.exe
*.csv *.csv
*.png
*.dia
Code-C/main Code-C/main
Code-C/exect Code-C/exect

View file

@ -24,28 +24,10 @@ double **getDoubleArray(int N, int M) /* Allocate the array */
array[i] = (double *)malloc(M * sizeof(double)); array[i] = (double *)malloc(M * sizeof(double));
return array; return array;
} }
/**
* @brief print all the element of a bidimensionnal array p of shape : N x M
*/
void printArrayData(long **p)
{
for (int i = 0; i < nRowRawData; i++)
{
printf("line n°%d : ", i);
for (int j = 0; j < nCol; j++)
{
printf("%ld , ", p[i][j]);
if (j == (nCol - 1))
printf("\n");
}
}
}
void fillArrayWithRawData(char *rawDataFileName, long **p, int N, int M) void fillArrayWithRawData(char *rawDataFileName, long **p, int N, int M)
{ {
<<<<<<< HEAD
int i = 0, j; int i = 0, j;
=======
>>>>>>> 1c7d7edaaed0245806ce2b0f5538935709632a03
char *buffer; char *buffer;
size_t bufsize = 200; size_t bufsize = 200;
buffer = (char *)malloc(bufsize * sizeof(char)); buffer = (char *)malloc(bufsize * sizeof(char));
@ -180,8 +162,6 @@ void printArrayData(long **p, int N, int M)
printf("\n"); printf("\n");
} }
} }
printArrayData(p);
fclose(f);
} }
/** /**
* @brief verify if all the element of an array are not NULL, return * @brief verify if all the element of an array are not NULL, return

View file

@ -6,7 +6,7 @@
#include <inttypes.h> #include <inttypes.h>
long **getRawDataArray(char *rawDataFileName); long **getRawDataArray(char *rawDataFileName);
void printArrayData(long **p); void printArrayData(long **p , int N , int M);
void freeArray(long **p, int N); void freeArray(long **p, int N);
bool checkArrayFullyFill(long **p, int N); bool checkArrayFullyFill(long **p, int N);
double **getDoubleArray(int N, int M); double **getDoubleArray(int N, int M);