title: Unable to increment structure variable
body: <pre><code>struct list{
      int *items;
      int length;
  };
      
  void add(int a, struct list input);
      
  void print(struct list input);
      
  int main(void){
      int size=0;
      
      struct list mine;
      mine.items=(int*) malloc(size * sizeof(int));
      mine.length=size;
      
      add(4,mine);
      add(5, mine);
      add(6, mine);
      
      print(mine);
      
  }
      
  void add(int a, struct list input){
      static int index=0;
      printf(&quot;%d\n&quot;, input.length);
      if(index&gt;=input.length){
          input.items=(int*)realloc(input.items, (input.length+1)*sizeof(int));
          input.length++;
      }
      input.items[index]=a;
      index++;
  }
      
  void print(struct list input){
      for(int i = 0; i&lt;input.length ;i++){
          if(input.items[i]&gt;0 &amp;&amp; input.items[i]&lt;16){
              if(input.items[i]&lt;10){
                  printf(&quot;L0%d &quot;,input.items[i]);
              }
              else{
                  printf(&quot;L%d &quot;,input.items[i]);
              }
          }
          else if(input.items[i]&gt;15 &amp;&amp; input.items[i]&lt;31){
              printf(&quot;I%d &quot;, input.items[i]);
          }
          else if(input.items[i]&gt;30 &amp;&amp; input.items[i]&lt;46){
              printf(&quot;N%d &quot;, input.items[i]);
          }
          else if(input.items[i]&gt;45 &amp;&amp; input.items[i]&lt;61){
              printf(&quot;U%d &quot;, input.items[i]);
          }
          else if(input.items[i]&gt;60 &amp;&amp; input.items[i]&lt;76){
              printf(&quot;X%d &quot;, input.items[i]);
          }
      }
  }
  </code></pre>
  <p>This program is supposed to print a number added to an array in a structure with a prefix 'L', 'I', 'N', 'U', 'X' depending on how big the number is. The issue is that input.length does not seem to want to increment in the add() function which causes the print() function to not print anything. Any clues as to why this is happening?</p>