first try after first fix strsep

This commit is contained in:
Aurélien Gauthier 2022-06-24 17:50:54 +02:00
parent fecd2124d7
commit a8c235bc65
3 changed files with 7 additions and 4 deletions

View file

@ -11,15 +11,17 @@
*/
void averageCalculation(long **p, double averageArray[])
{
printArrayData(p, nRowRawData, nCol);
printf("\n");
for (int i = 1; i < nCol; i++)
{
int j = 0;
averageArray[i] = 0;
while (j < nRowRawData)
{
printf("pij = %ld\n" , p[i][j]);
printf("pij = %ld\n", p[i][j]);
averageArray[i - 1] += (double)p[i][j];
printf("%f , %ld\n", averageArray[i] , p[i][j]);
// printf("%f , %ld\n", averageArray[i], p[i][j]);
j++;
}
averageArray[i] /= nRowRawData;

View file

@ -38,9 +38,9 @@ void fillArrayWithRawData(char *rawDataFileName, long **p, int N, int M)
for (i = 0; i < N; i++)
{
long t, c1, c2, c3;
while (fscanf(f, "%ld,%ld,%ld,%ld\n", &t, &c1, &c2, &c3))
while (fscanf(f, "%ld,%ld,%ld,%ld\n", &t, &c1, &c2, &c3) != EOF)
{ // séparation valeur par virgule initiale : csv
printf("%ld,%ld,%ld,%ld\n", t, c1, c2, c3);
// printf("%ld,%ld,%ld,%ld\n", t, c1, c2, c3);
p[i][0] = t;
p[i][1] = c1;
p[i][2] = c2;

View file

@ -96,6 +96,7 @@ void *threadCalculGrowthRate(void *vargp)
{
rawDataQueue = queueGetNextE(rawDataQueue);
fileName = queueGetTabChar(rawDataQueue);
printf("%s\n", fileName);
if (i < 2)
{
if (i == 1)