Say I have a function that takes a variable number of parameters: I want to call this function from somewhere else, building the list of parameters, but without knowing in advance how many parameters I'll need. 

Sorry that's not well explained, hopefully this code makes my question clearer:

```
void foo(int n, ...) {
    va_list vl;
    va_start(vl,n);

    for (int i = 0; i<n; i++) {
      // Do something to each passed variable
    }
}

```

That function's being called from this one:

```
void bar(int howManyParams) {

  // Here I want to call foo() with howManyParams parameters
  // (values are irrelevant for the question)
  // 
  // I.e. for howManyParams = 1, we should call foo(0)
  //      for howManyParams = 2, we should call foo(0,0)
  //      for howManyParams = 3, we should call foo(0,0,0)
  // etc.
  //

}

```