Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Do pointers exist in .NET?

Tags:

c#

.net

pointers

I want to know if pointers exist in .NET technology. If yes, is there any example for pointers in C#?

Please guide me .

like image 769
Red Swan Avatar asked Aug 31 '10 12:08

Red Swan


People also ask

Do pointers exist in C#?

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.

What is .NET pointer?

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 */

Why are pointers not used in C#?

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.

What are pointer types in C#?

There are majorly four types of pointers, they are: Null Pointer. Void Pointer. Wild Pointer. Dangling Pointer.


1 Answers

Yes, they do exist...

  • Pointer types

And an example of their use...

  • How to: Use Pointers to Copy an Array of Bytes
like image 125
LukeH Avatar answered Sep 19 '22 17:09

LukeH