Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- struct Vector2 {
- float x;
- float y;
- public Vector2(float x, float y) { this.x = x; this.y = y; }
- }
- class Example {
- static void Main() {
- Vector2[] arr = new Vector2[] { new Vector2(0,0), new Vector2(1,1) }
- List<Vector2> list = new List<Vector2>();
- list.Add(new Vector2(0,0));
- list.Add(new Vector2(1,1));
- arr[0].x = 1; // works?
- list[0].x = 1; // would work if list[] could return reference to element
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement