首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > C# >

vs2005 c# 怎么使用lambda表达式?

2012-07-15 
vs2005 c# 如何使用lambda表达式??C# codestatic void Main(string[] args){del myDelegate x x * x

vs2005 c# 如何使用lambda表达式??

C# code
                 static void Main(string[] args)        {            del myDelegate = x => x * x;//这里编译会提示>是无效的表达式项哇            int j = myDelegate(5); //j = 25            Console.WriteLine(j.ToString());            Console.ReadKey();         }         delegate int del(int i);


求救哇 无语了

[解决办法]
lamda表达式是.net3.0+才有的
你需要使用VS2008+ .NET3.0+才行

热点排行