Posted By

jiewmeng on 08/14/10


Tagged

c


Versions (?)

Who likes this?

3 people have marked this snippet as a favorite

Tyster
cygnusfear
Priestd09


C# Basics: Delegates


 / Published in: C#
 

  1. delegate string DelegateTest(string str);
  2.  
  3. DelegateTest delTest = new DelegateTest(Class1.Hello);
  4. Console.WriteLine(delTest("LOL"));
  5.  
  6. class Class1{
  7. ...
  8. public static string Hello(string msg) {
  9. return "Hello " + msg;
  10. }
  11. }

Report this snippet  

You need to login to post a comment.