title: C++ Passing an array directly into a function without initializing it first
body: <p>Lets say you have created this function:</p>
  
  <pre><code>void function(int array1[2], int array2[2])
  {
      // Do Something
  }
  </code></pre>
  
  <p>Is it possible to do something like this in C++</p>
  
  <pre><code>function([1,2],[3,4]);
  </code></pre>
  
  <p>Or maybe this can better described as </p>
  
  <pre><code>function({1,2},{3,4});
  </code></pre>
  
  <p>The only way I know of accomplishing this is to do:</p>
  
  <pre><code>int a[2] = {1,2};
  int b[2] = {3,4};
  function(a,b);
  </code></pre>