Which of the following is the correct way to call the function MyFun() of the Sample class given below? class Sample { public int MyFun(int i) { Console.WriteLine("Welcome to CuriousTab.com !" ); return 0; } }
Correct Answer: delegate int del(int i);
del d;
Sample s = new Sample();
d = new del(ref s.MyFun);
d(10);
Discussion & Comments