title: how do i get values stored in struct?
body: <p>I am trying to retrieve values from an array of structs. I do not know the correct ways to retrieve them.</p>
  
  <p>Here is my struct:</p>
  
  <pre><code>struct entry{
      char name[NAME_SIZE];
      int mark;
  };
  
  typedef struct entry Acct;
  Acct dism2A03[MAX_ENTRY];
  </code></pre>
  
  <p>How i assigned values:</p>
  
  <pre><code>void add_new(char *name,int mark){
      printf("%s,%d",name,mark);
      int v=0;
      v=entry_total;
      strcpy(dism2A03[v].name,name);
      dism2A03[v].mark = mark;
  }
  </code></pre>
  
  <p>What i tried (DOES NOT WORK):</p>
  
  <pre><code>int m=0;
  for(m=0;m&lt;MAX_ENTRY;m++){
                  char name[NAME_SIZE] = dism2A03[m].name;
      line 75 &gt;&gt;          int mark = dism2A03[m].mark;
                  printf("\nEntry %d",m);
                  printf("%s",name);
                  printf("%d",mark);
               }
  </code></pre>
  
  <p>ERROR:
      p9t2.c: In function ‘main’:
      p9t2.c:75:5: error: invalid initializer</p>