I’m new in C and would love to get some help regarding multipule input
for example I have this struct:
typedef struct person{
char * name;
int age;
}
and I want to write a function that get’s :name age name age name age…
Is there a way I can do that ? how can I later get the values?
I mean something like :
void my_func(char* name, int age , char* name1,int age1.....)
like in JAVA I can use “…”
I want to do something like that :
void my_func(char* name, int age , char* name1,int age1.....){
int num_of_ppl = length of the input/2
person p1 ;
p1.name = first input name
p1.age = first input age
etc..
thanks!
If you want a function with variable argument list you can use va_list