Pointers in C#?
So I've heard that pointers, although usable in C#, aren't exactly what people would use in it. I am, however, still interested in learning basic syntax for it. Does anyone know how or what to do?
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 attend5days leftRegister
AlanRank #669 · 3.6K reputationPosted Mar 4, 2008, 9:22 AM EST
You can only use pointers in C# within what's called an 'unsafe' context. As it's too large a subject to cover in a few lines, can I refer you to these three links for more details:
http://msdn2.microsoft.com/en-us/library/t2yzs44b.aspx
http://69.10.233.10/KB/cs/unsafe.aspx
http://www.c-sharpcorner.com/UploadFile/PatrickSmacchia/CSharp2UnsafeCode02162006063859AM/CSharp2UnsafeCode.aspx
J Elasigue9 reputationPosted Mar 4, 2008, 9:41 AM EST
dilipv vishwakarma25 reputationPosted Mar 4, 2008, 9:21 PM EST
hi there,
A pointer is a variable that holds the memory address of another type. In C#, pointers can only be declared to hold the memory addresses of value types (except in the case of arrays ).
Pointers are declared implicitly, using the 'dereferencer' symbol *, as in the following example:
[Note that some coders place the dereferencer symbol immediately after the type name, This variation appears to work just as well as the previous one.]
There several article based on it. You need to make detailed study about it. Just checkout the given links as follows.
Hope this will help you.
Thanks & Regards
Dilipv
SharePoint Consulting