I want to know if pointers exist in .NET technology. If yes, is there any example for pointers in C#?
Please guide me .
A pointer is simply a variable that holds the memory address of another type or variable. By default, C# does not allow you to use pointers in your apps.
Pointer is a variable whose value is the address of another variable i.e., the direct address of the memory location. The syntax of a pointer is − type *var-name; The following is how you can declare a pointer type − double *z; /* pointer to a double */
C# supports pointers in a limited extent. A C# 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.
There are majorly four types of pointers, they are: Null Pointer. Void Pointer. Wild Pointer. Dangling Pointer.
Yes, they do exist...
And an example of their use...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With