title: Why am I getting "void value not ignored as it ought to be"?
body: <p>I have the following function :</p>
  
  <pre><code>void getdata(int arr[], int n)
  {
  
      for (int i = 0; i &lt; n; i++) 
      {
          int a = srand(time(NULL));
          arr[i] = a;
      }
  }
  </code></pre>
  
  <p>And I call it in <code>main</code>:</p>
  
  <pre><code>getdata(arr, 1024);
  </code></pre>
  
  <p>I get "void value not ignored as it ought to be" but I don't understand what is wrong.Why do I get this error?</p>