我还没能通过典型的渠道找到这个问题的答案。在
在Python中,我可以有以下函数定义
def do_the_needful(**kwargs):
# Kwargs is now a dictionary
# i.e. do_the_needful(spam=42, snake='like eggs', spanish='inquisition')
# would produce {'spam': 42, 'snake': 'like eggs', 'spanish': 'inquisition' }
我知道.NET有ParamArray
,它产生一系列未命名的参数,类似于Python中的*args
语法。。。.NET是否有**kwargs
的等价物,或者类似的东西?在
你要找的是一个变量函数。如果您想知道如何用不同的编程语言实现它,最好的方法是看看关于它的Wikipedia page。在
因此,根据维基百科的说法,在C和VisualBasic中实现一个可变函数是这样完成的:
相关问题 更多 >
编程相关推荐