fscanf resulting in segfault
<p>I'm trying to read a bunch of <code>int</code>s from a .txt file and store them in memory. The <code>fscanf()</code> line in the below code is causing a segmentation fault whenever I try to run it, though. I've confirmed that `fopen() is working properly. Any idea what I should do? Thanks for your help.</p>

<pre><code>#include &lt;stdio.h&gt;
#include &lt;stdlib.h&gt;




void load_file(FILE* file, int** p);

int main()
{

    FILE* f1;
    f1 = fopen("twenty-five-ints.txt", "r");
    int p=0;
    int* k = &amp;p;
    load_file(f1, &amp;k);
    return 0;
}

void load_file(FILE* file, int** p) {

    int number = 0;
    int i = 0;
    while (fscanf(file, "%d", &amp;number) != EOF) {
        *(*p + i) = (int) fscanf(file, "%d", &amp;number);
        i++;
    }

}
</code></pre>