title: Initializing a float array with memset
body: <p>This is the code that I want to try to write:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;math.h&gt;
  #include &lt;stdlib.h&gt;
  #include &lt;string.h&gt;
  #include &lt;malloc.h&gt;
  
  int main(int argc, char *argv[])
  {
      float arry[3] = {0};
  
      memset(arry, (int) 10.0, 3*sizeof(float));
  
      return 0;
  }
  </code></pre>
  
  <p>My problem is that I want to see if it's possible to use memset to make every entry of an array to be a number other than 0. However, After stepping through that line, the array contents change to a very small number (0). I wonder what I'm doing wrong in this case with using the memset() function. I hope this isn't a duplicate post, as none of the suggested related questions as I'm typing this appears to be.</p>