Asking
please give me a broad explanation on filing and pointer in C#
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend4days leftRegister
Satyapriya NayakRank #47 · 31.5K reputationPosted Apr 22, 2012, 7:16 PM EDT
Please refer the below links
http://imrannazar.com/Using-Pointers-in-C
http://www.codeproject.com/Articles/1453/Getting-unsafe-with-pointers-in-C
Thanks
Jignesh TrivediRank #16 · 50.3K reputationPosted Apr 22, 2012, 7:38 PM EDT
C# supports pointers in a limited extent. A pointer is nothing but a variable that holds the memory address of another type. But in C# pointer can only be declared to hold the memory address of value types and arrays. Unlike reference types, pointer types are not tracked by the default garbage collection mechanism. For the same reason pointers are not allowed to point to a reference type or even to a structure type which contains a reference type.
Declaring a Pointer type
int *myPointer;
you can use pointer using unsafe keyword.
unsafe
{
int x = 10;
int *ptr1 = &x;
Console.WriteLine((int)ptr1);
Console.WriteLine(*ptr1);
}
hope this help.
SenthilkumarRank #387 · 6.5K reputationPosted Apr 22, 2012, 9:59 PM EDT
For more info:
http://msdn.microsoft.com/en-us/library/y31yhkeb(v=vs.80).aspx
http://imrannazar.com/Using-Pointers-in-C