title: Declaring array of structs
body: <p>I have an array</p>
  
  <pre><code>int arr*;
  </code></pre>
  
  <p>I have declared a struct</p>
  
  <pre><code>struct counter{
      int index=0;
      int count=0;
      int *values;  // array
  }
  </code></pre>
  
  <p>and the array will have a predefined max size. </p>
  
  <p>How do I "push" structs inside each index of array? I have tried to do as following:</p>
  
  <pre><code>for ( int i =0; i &lt; max ; i ++ ){
      arr[i]=counter Store_Struct;
      arr[i]-&gt;values=(int *)malloc ( 2 * sizeof ( int ));
  }
  </code></pre>
  
  <p>but this little piece of code didn't work. How can I push structures as array values?</p>