我有这样的功能:
example(long a,long b,string c,DateTime d,DateTime e,out decimal f)
当我尝试调用它时,我正在这样做:
long a =1;
long b=2;
string c="";
DateTime d=DateTime.Now;
DateTime e=DateTime.Now;
decimal f=0;
example(a,b,c,d,e,f) --> Here is giving me the error : the best overloaded method has some invalid argument
你能帮我解决这个问题吗
最佳答案
你需要调用example(a,b,c,d,e, out f);
而且f
不需要初始化,最好不要初始化(误导):
//decimal f=0;
decimal f;
关于c# - 尝试调用具有 out 参数的函数时出现问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18843195/