Passing arguments to another variadic function
问题 Is there any way at all for this code to compile and work as intended without resorting to va_list stuff ? #include <iostream> void fct(void) { std::cout << std::endl; } void fct(int index, int indexes...) { std::cout << index << ' '; fct(indexes); //or fct(indexes...); ? } int main(void) { fct(1, 2, 3, 4, 5, 6, 7); return 0; } 回答1: I suspect you have misunderstood the meaning of the signature void fct (int index, int indexes...) I suspect you think that fct() expect a int single value (