call text file with words and numbers into arrays in a single function prototype
<p>I aimed to read text file such as</p>

<p><strong>File</strong>:</p>

<pre><code>1 2 93  35  I_have_no_idea
2 4 5 45 I_dont_care 
</code></pre>

<p>I want to read in into arrays (5 arrays)</p>

<p><strong>Code</strong>:</p>

<pre><code>int read_data(int id[], double year[], double earning[], double budget[], char name[]){
    int i, nmovies;
    int ch;
    if ((ch = getchar())==EOF){
        return -1;
    }
    for (i=0; scanf("%d", id+i)==1 &amp;&amp; scanf("%d", id+i) != EOF ; i++){
        while(fscanf(
        scanf( "%lf %lf %lf %s\n", year+i, earning+i, budget+i, name+i);
    }
    nmovies = i;
    return nmovies;
}
</code></pre>

<p>But it just giving me single id value.</p>

<p>What is wrong and how this should be changed?</p>