The program compiles fine. I used gcc -Wall, and no errors were shown.
But somehow the function storeFreqDrift is not executed after the rest of the 
code. Any ideas why? Maybe some problem with pointers? at end of the code there is the file input (each number is in a new row). I want to return the array value from the function. Everything works fine so far, but now I'm stuck.
#include <stdio.h>
#include <stdlib.h>
int freqCount;
int calcFreqDrift(const char *file_name, int *result);
int storeFreqDrift(const char *file_name, int tab[freqCount]);
int main() {
    int result = 0;
    freqCount = calcFreqDrift("numbers.txt", &result);
    printf("total number of frequencies is   %d", freqCount);
    int tab[freqCount]; 
    tab[freqCount] = storeFreqDrift("numbers.txt", &tab[freqCount]);
    printf("kolumna nr 3 to %d", tab[3]);
}
int calcFreqDrift(const char *file_name, int *result) {
    FILE *file = fopen("numbers.txt", "r");
    int i = 0;
    int freqCount = 0;  
    if (file == NULL) {
        printf("unable to open file %s", file_name);
    }
    while (fscanf(file, "%d", &i) == 1) {
        freqCount++;
        printf ("%d\n ", i);
        *result += i;
        printf("\n we are at row nr. %d sum of this number and all numbers before is: %d\n", freqCount, *result);
    }
    fclose(file);
    return freqCount; 
}
int storeFreqDrift(const char *file_name, int tab[freqCount]) {
    for (int i = 0; i < freqCount; i++) {
        tab[i] = 5 + tab[i - 1];
    }
    return tab[freqCount];
}
numbers.txt:
-14
+15
+9
+19
+18
+14
+14
-18
+15
+4
-18
-20
-2
+17
+16
-7
-3
+5
+1
-5
-11
-1
-6
-20
+1
+1
+4
+18
+5
-20
-10
+18
+5
-4
-5
-18
+9
+6
+1
-19
+13
+10
-22
-11
-14
-17
-10
-1


&tab[freqCount]as second argument being in theory tab !&tab[freqCount]is just after the last element of tab