void fib(int **fib_sequence, int count){
        *fib_sequence = malloc(sizeof(int) * count);
        if (count >= 1){
                (*fib_sequence)[0] = 0;
        }
        if (count >= 2){
                (*fib_sequence)[1] = 1;
        }
        if (count >= 3){
                for (int i = 2; i < count; i++){
                        (*fib_sequence)[i] = (*fib_sequence)[i-2] + (*fib_sequence)[i-1];
                }
        }
}

int main(int argc, char **argv) {
    /* do not change this main function */
    int count = strtol(argv[1], NULL, 10);
    int *fib_sequence;

    fib(&fib_sequence, count);
    for (int i = 0; i < count; i++) {
        printf("%d ", fib_sequence[i]);
    }
    free(fib_sequence);
    return 0;
}
Building a dynamic array containing the first n elements of the Fibonacci sequence