title: initialize float-type array using memset
body: <p>I have a pointer <code>float *ptr</code>, after dynamic allocation with length <code>n</code>, I want to initialize this array with zero or one, so I use <code>memset(ptr,0,n*sizeof(float))</code> or <code>memset(ptr,1,n*sizeof(float))</code>. Is this legal? Because the second argument of <code>memset</code> is int-type, I'm afraid it cannot be applied to float-type.</p>