title: I cant fill an array in C all with 0. Im trying memset and array[]={0};
body: <p>I'm using <code>memset</code> to fill an array with all zeros but I think <code>memset</code> is not working properly (when I debug it in a compiler it does not fill it with all zeros (IDK WHY?)).</p>
  <p>When I use for example <code>B[n] = { 0 }</code> I get an error:</p>
  <pre><code>variable-sized object may not be initialized
  </code></pre>
  <p>The code:</p>
  <pre class="lang-cpp prettyprint-override"><code>#include &lt;stdio.h&gt;
  
  int main()
  {
      int m, n;
      scanf(&quot;%d%d&quot;, &amp;m, &amp;n);
      int A[m][n];
      int B[n];
      int redici = 0, koloni = 0, vkupno = 0;
      //memset(B, 0, n);
      B[n] = { 0 };
      int popolnetaR[m], popolnetaK[n];
      memset(popolnetaR, 0, m - 1);
      memset(popolnetaK, 0, n - 1);
      return 0;
  }
  </code></pre>