Why am I getting “void value not ignored as it ought to be”?

I have the following function :

void getdata(int arr[], int n)
{

    for (int i = 0; i < n; i++) 
    {
        int a = srand(time(NULL));
        arr[i] = a;
    }
}

And I call it in main:

getdata(arr, 1024);

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?

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)