title: Initialize values of array in a struct
body: <p>I have a struct which has several arrays within it. The arrays have type unsigned char[4].</p>
  
  <p>I can initialize each element by calling </p>
  
  <pre><code>struct-&gt;array1[0] = (unsigned char) something;
  ... 
  struct-&gt;array1[3] = (unsigned char) something;
  </code></pre>
  
  <p>Just wondering if there is a way to initialize all 4 values in one line.</p>
  
  <p>SOLUTION: I needed to create a temporary array with all the values initialized, then call memset() to copy the values to the struct array.</p>