int *fib(int **fib_sequence, int n){
        int *fib = malloc(sizeof(int) * n);
        *fib_sequence = fib;
        int num1 = 0;
        int num2 = 1;
        for (int i = 0; i < n; i++){
                fib[i] = num1 + num2;
                num2 = fib[i];
                num1 = num2;
        }
        return fib;
}

Define a function void fib(...) below. This function takes parameter n
 * and generates the first n values in the Fibonacci sequence.  Recall that this
 * sequence is defined as:
 *         0, 1, 1, 2, 3, 5, ... , fib[n] = fib[n-2] + fib[n-1], ...
 * The values should be stored in a dynamically-allocated array composed of
 * exactly the correct number of integers. The values should be returned
 * through a pointer parameter passed in as the first argument.