title: Reading from a file into an array and storing the answer in another
body: <p>The below script is reading questions from a file and looping round and asking them to the user, i want the users answer to be stored in the array q.a and then at the end of the programme bot the questions ans the answers shown. All that happens at the minute is the last question asked and the last answer given is displayed 11 times. Can someone please help?</p>
  
  <pre><code>  struct qa{
    char q[40][250];
    char a[40][250];
    };
  
   int main()
   {
     int a, i, k, l, j;
  
     FILE *fp;
     fp = fopen("quest.txt", "r");
     if (fp == NULL){
          printf("nope nothing in there\n");
     }
  
     struct qa q;
  
        for(i&gt;0;i&lt;=11;i++){
        fgets(q.q[l], 250, (FILE*)fp);
        printf("%s", q.q[l]);
        scanf("%s", q.a[l]);
        }
  
        for (i = 0; i &lt; 11; i++){    
          printf("%s\n %s\n", q.a[l], q.q[l]);
        }
  }
  </code></pre>