-
-
Save torokati44/0d1fb6387e47afcfe43c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
namespace dlgt | |
{ | |
delegate void LoggerDelegate(int a, int b, int p); | |
class DataHandler | |
{ | |
public void DoOperation (int a, int b, LoggerDelegate d) | |
{ | |
d(a, b, a*b); | |
} | |
} | |
class MainClass | |
{ | |
static void LogToStdOut (int a, int b, int p) | |
{ | |
System.Console.WriteLine("{0} * {1} = {2}", a, b, p); | |
} | |
public static void Main (string[] args) | |
{ | |
DataHandler dh = new DataHandler(); | |
dh.DoOperation(2, 3, LogToStdOut); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment