Member access using →

suggest change

C# inherits from C and C++ the usage of the symbol -> as a means of accessing the members of an instance through a typed pointer.

Consider the following struct:

struct Vector2
{
    public int X;
    public int Y;
}

This is an example of the usage of -> to access its members:

Vector2 v;
v.X = 5;
v.Y = 10;

Vector2* ptr = &v;
int x = ptr->X;
int y = ptr->Y;
string s = ptr->ToString();

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:


Pointers:
* void
* Member access using

Table Of Contents
17 Regex
19 Arrays
21 Enum
22 Tuples
24 GUID
27 Looping
36 Casting
46 Methods
88 Events
92 Structs
104 Indexer
106 Stream
107 Timers
109 Threading
127 Caching
135 Pointers
147 C# Script