Web Hosting Talk







View Full Version : pointers in C#...hoe to implement....


georgemelick
04-23-2008, 02:37 PM
Hi there....

How do I implement function pointers in C#?

thanks for any reply...

Kevin_D
04-23-2008, 03:36 PM
Delegates provide the functionality of function pointers in C#.

See this MSDN article (sorry cant post links yet):

msdn2.microsoft.com/en-us/library/ms173171.aspx

Steve_Arm
04-23-2008, 03:37 PM
You use an unsafe block:
unsafe
{
int x = 1;
int *p = &x;
}

Or use delegates:

private delegate int foo(string str);