but then y is an Array of at least one value. You could ignore the values beginning from the third position. That is the literal answer to the question in the title, but you probably just want to do this:
void move(int x, int y)
{
move(x, y, 0);
}
void move(int x, int y, int z)
{
}
This is called overloading: there are two move() methods but they have a different number of arguments so they are treated as different methods. The first move() method just calls the second with the z parameter equal to 0.
Answers
no, but this would:
but then y is an Array of at least one value. You could ignore the values beginning from the third position. That is the literal answer to the question in the title, but you probably just want to do this:
This is called overloading: there are two move() methods but they have a different number of arguments so they are treated as different methods. The first move() method just calls the second with the z parameter equal to 0.
very helpful
flexible number of parameters...