title: Simpler way to set multiple array slots to one value
body: <p>I'm coding in <a href="https://en.wikipedia.org/wiki/C++" rel="nofollow noreferrer">C++</a>, and I have the following code:</p>
  
  <pre><code>int array[30];
  array[9] = 1;
  array[5] = 1;
  array[14] = 1;
  
  array[8] = 2;
  array[15] = 2;
  array[23] = 2;
  array[12] = 2;
  //...
  </code></pre>
  
  <p>Is there a way to initialize the array similar to the following?</p>
  
  <pre><code>int array[30];
  array[9,5,14] = 1;
  array[8,15,23,12] = 2;
  //...
  </code></pre>
  
  <p>Note: In the actual code, there can be up to 30 slots that need to be set to one value.</p>