I have initialized an array like this array[n][k+1]={0}
where n and k are user input. But I found that it doesn't initialize all index values to zero. While on the other hand memset(array,0,sizeof(array))
works fine. So why this happened?
Because each time I initialised like this array[n][n]={0}
, it always works fine. But why not in this case.