[英]How to pass different numbers of parameters in a same function?
I got similar questions of this, but not get satisfied answer. 我对此也有类似的问题,但没有得到满意的答案。
I have a function 我有一个功能
func(int a,int b)
{
//code....
}
This function accepts two parameters (a and b). 该函数接受两个参数(a和b)。 I want to pass different number of parameters in this same function.
我想在同一函数中传递不同数量的参数。 I know there is a concept of overloading but I don't know how many numbers of parameters I'll pass.
我知道有一个重载的概念,但是我不知道要传递多少个参数。 I am working in C#(asp.net).
我在C#(asp.net)中工作。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.