Garmaine Staff asked 2 years ago

I've created a dynamic 2-d array, but I don't know how to use memset in that? Here's a piece of my code-

ll **arr;
arr = new ll*[n];
for(int i=0; i<n; i++){
    arr[i] = new ll[x];
}

I'm doing memset(arr, -1, ((n*x))* sizeof(*arr)) but it is not working. can anyone help?