title: How can I pass a braced-list / dynamic array into a function (c++)
body: <p>I have a function that accepts arrays of variable size, but it is still somewhat messy and I am having trouble condensing it into something that is easier to work with. I'm <em>not</em> asking to be spoonfed, but I am looking for some advice on how to potentially remedy this. </p>
  
  <p>Here is how I have to setup variables to pass into the function, extremely tediously and redundantly:</p>
  
  <pre><code>DWORD xAAR[4] = { base, 0x5EC5E4, 0x5A8, 0x3C };
  x = pGet(xAr, 5);
  </code></pre>
  
  <p>Here is how what I want to condense it to (bearing in mind that the amount of elements will differ for each usage):</p>
  
  <pre><code>x = pGet({ base, 0x5EC5E4, 0x5A8, 0x3C });
  </code></pre>
  
  <p>Below is the function itself, with the meat of it excluded for brevity.</p>
  
  <pre><code>DWORD pGet(DWORD p[], int sizeA)
  {
      DWORD address;
      for (int i = 1; i &lt; sizeA; i++)
      {
      }
      return NULL;
  }
  </code></pre>