U
utab
Dear all,
I have a function to get some string arguments. The point is that the
number of these string arguments may vary. So
foo(std::vector<std::string> &vec);
But I want to be able to initialize this vector at run-time with
different number of arguments. for instance
foo("str1","str2") // 2 args
foo("str1","str2","str3") // 3 args
foo("str1","str2","str3","str4") // 4 args and so on
I could find the way to put these parameters into the vector. Or is
there a better way to do this kind of task.
Regards
I have a function to get some string arguments. The point is that the
number of these string arguments may vary. So
foo(std::vector<std::string> &vec);
But I want to be able to initialize this vector at run-time with
different number of arguments. for instance
foo("str1","str2") // 2 args
foo("str1","str2","str3") // 3 args
foo("str1","str2","str3","str4") // 4 args and so on
I could find the way to put these parameters into the vector. Or is
there a better way to do this kind of task.
Regards