嗨,我正在学习使用Lambda从书中。我从书上抄VS2010一段代码后,我得到了错误:C#表达式Lambda
Delegate '
System.Func<float>
' does not take 1 arguments"
VS2010标记在第3行左括号下的错误,“浮动X”之前。你能告诉我什么是错的吗?
static void Main(string[] args)
{
Func<float> TheFunction = (float x) =>
{
const float A = -0.0003f;
const float B = -0.0024f;
const float C = 0.02f;
const float D = 0.09f;
const float E = -0.5f;
const float F = 0.3f;
const float G = 3f;
return (((((A * x + B) * x + C) * x + D) * x + E) * x + F) * x + G;
};
Console.Read();
}
因为你看起来有点缺乏代表+1 –
@Garry你投票回答问题,而不是书。 –