In C++11 we have Variadic functions that we can call with varying number of arguments. https://stackoverflow.com/a/1657930/2402577
void myfunc( int i = 0, int j = 1, int k = 2 );
// other code... myfunc(); myfunc( 2 ); myfunc( 2, 1 ); myfunc( 2, 1, 0 );
I have point out that it is not possible, instead could we just sent an array list into the function, and embedded arguments into the list:
function foo(uint hello[]){
uint x = hello[hello.len];
return x + 1;
}
[Q] Is it possible to make something similar inside Solidity with an array-list[] as an argument to the function?