C# Programming
05-04-2009, 06:51 PM
See anything wrong here? Pasted out of MSDN to a Console application (C#).
delegate int del(int i); //error?
del myDelegate = x => x * x;
int j = myDelegate(5); //j = 2
VS 2008 / .NET 3.5
http://www.barakasoft.com/script/Forums/Images/smiley_confused.gif
http://msdn.microsoft.com/en-us/library/bb397687.aspx[^ (http://msdn.microsoft.com/en-us/library/bb397687.aspx)]
Jon
delegate int del(int i); //error?
del myDelegate = x => x * x;
int j = myDelegate(5); //j = 2
VS 2008 / .NET 3.5
http://www.barakasoft.com/script/Forums/Images/smiley_confused.gif
http://msdn.microsoft.com/en-us/library/bb397687.aspx[^ (http://msdn.microsoft.com/en-us/library/bb397687.aspx)]
Jon