I'm asking how to create a function with default parameters with the possibility to init the parameters that you need.
Code Example :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
#include <iostream>
int func(int a = 1, int b = 2, int c = 3, int d = 4)
{
return a + b * c / d;
}
int main(int ac, char** av)
{
(void)ac;
(void)av;
std::cout << func(b = 42, d = 31) << std::endl;
std::cout << func(12, d = 28) << std::endl;
std::cout << func(d = 1, c = 2, b = 3, d = 4) << std::endl;
}