I was wondering if it's possible in C to create a variadic function that takes different types of arguments. i.e.
void fillDatabase(char* name, int age){
writeToDatabase(name, age);
}
int main(){
fillDatabase("Paul", 19);
fillDatabase("Herbert");
}
Here I am trying to fill up a database with names and ages. But it's also possible to fill it up with only a name and no age. So I am wondering if I could use the same function for that or if I have to write two different ones?
Online I could only find examples for variadic functions with the same type of arguments.
Thanks in advance!