title: initializing an array of ints
body: <p>Does anyone have a way to initialize an array of <code>int</code>s (any multi-byte type is fine really), to a non-zero and non -1 value simply? By which I mean, is there a way to do this in a one liner, without having to do each element individually:</p>
  
  <pre><code>int arr[30] = {1, 1, 1, 1, ...}; // that works, but takes too long to type
  
  int arr[30] = {1}; // nope, that gives 1, 0, 0, 0, ...
  
  int arr[30];
  memset(arr, 1, sizeof(arr)); // That doesn't work correctly for arrays with multi-byte
                               //   types such as int
  </code></pre>
  
  <p>Just FYI, using <code>memset()</code> in this way  on static arrays gives:</p>
  
  <pre><code>arr[0] = 0x01010101
  arr[1] = 0x01010101
  arr[2] = 0x01010101
  </code></pre>
  
  <p>The other option:</p>
  
  <pre><code>for(count = 0; count &lt; 30; count++)
     arr[count] = 1;    // Yup, that does it, but it's two lines.
  </code></pre>
  
  <p>Anyone have other ideas? As long as it's C code, no limits on the solution. (other libs are fine)</p>