Flexible function parameters

I don't know where to start on this so if someone else has asked this question or there's good source, I'm happy to look there. I simply don't know how to ask this question and find related topics.

The print function Serial.print() is capable of parsing all sorts of parameters; int, char *, long etc. How does one go about creating a function like that? ...and is this a function of the language or are these coded with something like a case? I suspect I'm touching on object oriented issues and I grew up programming in a pre-object orientation so I'm happy to read and bring myself up-to-speed, I just need the terminology (or a pointer to the right source) so I know what to search on. Thank you in advance for your help.

Hi
what you mean is named "template"

and it works like this

template<typename Var>
void Function(Var a){
}

so Var has become a variable thats a int , byte , long, float. depant on the variable you use inside the sketch.

look at this Link

Thank you for your quick response. I managed to stumble across another possible solution which is an overloaded function call. I found it by searching "optional arguments" (it helps to call them by their correct names; arguments, not parameters). Optional arguments might serve the purpose. However I also came across overloaded functions along the way and these will definitely help if I need to have completely different arguments as opposed to just some that are optional.

I suspect, as with any powerful concept, there are gotchas and caveats for these approaches and I would be happy for any insight, but at least at this point, I have the terminology and am finding ideas to try. I will be interested to see the memory cost, both flash and SRAM, of these approaches.

Thanks again for your quick response.