Created
May 15, 2019 07:31
-
-
Save paulohenriquesn/7ba580e09ca43aeb4f6f2a45c33b9026 to your computer and use it in GitHub Desktop.
Array Extension
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
public class _int | |
{ | |
//Author Paulo Henrique | |
private Int32[] _ = new Int32[1024]; | |
private short index; | |
public void setIndex(short value) { index = value; } | |
public short getIndex() { return this.index; } | |
public Int32 GetValue(Int32 pos) | |
{ | |
return _[pos]; | |
} | |
public void SetValue(int pos, Int32 value) | |
{ | |
_[index] = value; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Example
List<_int> minhasArrays = new List<_int>(); for (int x = 0; x < 1024; x++) { minhasArrays.Add(new _int()); } minhasArrays[100].SetValue(0, 123456); Console.WriteLine(minhasArrays[100].GetValue(0)); Console.WriteLine(minhasArrays[20].GetValue(0)); Console.ReadKey();