To pass default parameters to a function, use this syntax in a function declaration:
void foo(int a, int b = 1000); foo(42);
You can have an arbitrary number of default parameters, but they cannot have non-default parameters to the right of the default value, so this is not legal:
void foo(int a, int b = 1000, int c);
but this
void foo(int a, int b = 1000, int c = 42);
As for your re-declaration error, just don't declare delay again:
} else { delay = 1000; }
or
delay = (parameters > 1) ? std::max(delay, popNumber(L)) : 1000;
source share