Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

How to handle general function overloading and polymorphism in Ch?

0
Posted

How to handle general function overloading and polymorphism in Ch?

0

Ch supports function overloading or polymorphism. The syntax of function overloading in Ch is different from that in C++. But, sementically, they are more or less the same. Ch let users overload a function by themselves. In C, a function must have at least one named parameter if you have variable-length argument list. Ch supports this feature. Moreover, Ch supports variable length argument without specifying the first named argument in the form of “type funcname(…)”. Thus the number and types of arguments are flexible and can be overloading with the same function name, except that the function return value type has to be fixed and cannot be overloaded. However, you can put the returned value of different types into a function argument if it is a concern. The number of arguments, data type of each argument, array information for array argument, etc. are available to users for function overloading.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123