title: C++: how do I pass a variable for multiple arguments?
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/3555583/passing-variable-number-of-arguments-with-different-type-c">Passing Variable Number of Arguments with different type - C++</a>  </p>
  </blockquote>
  
  
  
  <p>I have a function that takes n arguments.</p>
  
  <p>And I want to call it like, <code>function_name(number_args - 1, input, args_from_console[], output)</code></p>
  
  <p>How do I do that?</p>
  
  <p>*the function that takes n arguments already is written and works... I just don't want to hard code the variables being passed in. </p>
  
  <p>Edit: (adding code)</p>
  
  <pre><code>struct fann *ann = fann_create_standard(num_layers, 
                                              Config::NUMBER_OF_INPUT_NEURONS,
                                              Config::WIDTH_IN_BITS, 
                                              Config::WIDTH_IN_BITS, 
                                              Config::NUMBER_OF_OUTPUT_NEURONS);
  </code></pre>
  
  <p>the function above can have at least 3 arguments... the required arguments are num_layers, num_input, and num_output)</p>
  
  <p>the optional arguments are the hidden layers of the neural network (what they are call isn't important.... but basically... it could look like this:</p>
  
  <pre><code>fann_create_standard(#layers, #input, #hidden1, #hidden2, #hidden3, #hidden4, ... #output);
  </code></pre>
  
  <p>what I want to be able to do, is pass in command line arguments to change how many layers, and what the values of each of the hidden layers are (the middle arguments in this function call), so that I don't have to re-compile the program every time I want to re-configure the network.</p>