0

i'm trying to write a function that takes an arbitrary number of parameters that in our case are supposed to be variables of different types, and gets their values from keyboard

here is the code of function call:

int a;
float  b;
char   c;
string d;

getValues(a, b, c, d);

Is it possible? I think that it is, help me please

Ch3steR
  • 20,090
  • 4
  • 28
  • 58
  • It is the first time I post something here, the 3 ` in the code are not in the actual code, and same for the last words at the end – Ales1297 Jun 11 '22 at 13:22
  • Refer to the linked duplicate that uses [variadic templates](https://en.cppreference.com/w/cpp/language/parameter_pack). [Demo](https://onlinegdb.com/6OS5updNj) – Jason Jun 11 '22 at 13:26

0 Answers0