title: C++ - passing declared array as argument to struct
body: <pre><code>    float_t rotations[6] = {1.0f, 2.5f, 3.0f, 4.0f, 5.0f, 6.0f};
      fla_algo_config_t config_alt = {20.0f,
                                  20.0f,
                                  {1.0f, 2.5f, 3.0f, 4.0f, 5.0f, 6.0f},
                                  mock_error_callback,
                                  nullptr};
  
      fla_algo_config_t config = {20.0f,
                                  20.0f,
                                  rotations,
                                  mock_error_callback,
                                  nullptr};
  </code></pre>
  
  <p>config_alt works. However, it is cumbersome to write out the entire array each time I would like to pass it to the struct. I would like to just pass the <code>rotations</code> array directly, so it doesn't need to be rewritten.</p>
  
  <p>However, I get the following error:</p>
  
  <p><code>error: array must be initialized with a brace-enclosed initializer
                                   nullptr};</code></p>
  
  <p>I am guessing it wants me to enclose rotations with braces. However, if I do this, now I am passing an array of arrays, but <code>fla_algo_config_t</code> expects an array.</p>
  
  <p>How can I pass the array? I have tried passing *rotations, but this only passes the first value.</p>