有没有办法在C ++中显式调用可选参数?

当我创建一个函数时,例如:

int addThree(int x=1, int y=1, int z=1)

我想调用该函数,使其使用x和z的默认参数,但不使用y。

Some attempts have been addThree(5,,5) and addThree(5,NULL,5), but neither work effectively. Hopefully these help convey my question better.

感谢任何帮助。干杯!

评论