access pointer to double array
<p>I have these structs:
</p>

<pre><code>typedef struct {
    char *start;
    char *loops;
    char *tolerance;
    double *numbers;
} configuration;

typedef struct {
    bool help;
    bool debug;
    const char *configFile;
    const char *inputFile;
    const char *outputFile;
    bool parallel;
    int fragmentSize;

} options;
</code></pre>

<p>When <code>inputFile</code> is <code>NULL</code> I set the double pointer(<code>config.numbers</code>) to the array: <code>double numbers[] = {3,5,7};</code> If there is an <code>inputFile</code> I read numbers from it into the array <code>numberList</code> After that I set the pointer <code>config.numbers</code> to <code>numberList</code>. This is the code:
</p>

<pre><code>//Safe number list into config
    if(opt.inputFile == NULL) {

        config.numbers = &amp;numbers[0];
        lines = 3;
    } else {
        //Count lines|numbers in file
        FILE* fp;
        fp = fopen(opt.inputFile,"r");
        int bh = 0;
        while(!feof(fp))
        {
            bh = fgetc(fp);
            if(bh == '\n')
            {
                lines++;
            }
        }
        fclose(fp);
        //End counting

        //Read numbers from file
        fp = fopen(opt.inputFile,"r");
        double numberList[lines];
        double number;
        int n;
        for (n = 0; n &lt; lines; n++) {
            fscanf(fp, "%lg", &amp;number);
            numberList[n] = number;
        }
        //End reading numbers from file
        config.numbers = &amp;numberList[0];

    }
    //End safing number list
</code></pre>

<p>When I print <code>numberList</code> in <code>else</code> with this for-Loop:
</p>

<pre><code>int z;
for(z = 0; z &lt; lines; ++z) {
      printf("%f\n", numberList[z]));
}
</code></pre>

<p>Everything works fine, but when I try to print the array using the pointer with this for-Loop:
</p>

<pre><code>int z;
for(z = 0; z &lt; lines; ++z) {
    printf("%f\n", *(config.numbers + z));
}
</code></pre>

<p>I get as result something like this:</p>

<pre><code>71861994.719069
28587064.020609
91127582.029965
34937973.383320
49643168.000000
0.000000
0.000000
27369248.460685
54686448.003485
93571557.380991
-nan
0.000000
0.000000
0.000000
0.000000
0.000000
0.000000
</code></pre>

<p>So how do I access the pointer correctly or did I something else wrong?</p>

<p>EDIT: 
The input file looks like this:</p>

<pre><code>95181223.701304
27539279.045323
25701472.780528
29898009.416600
72366798.330269
3326112.825110
79857126.893409
38880807.039738
8199298.711586
42132873.992498
34763372.472843
14076941.001265
79042893.824653
17188914.128202
93208812.499982
42846886.181667
80882719.243356
23444107.325489
</code></pre>

<p>I expect the same output.</p>

<p>initialising Lines:</p>

<pre><code>int lines = 0;
</code></pre>