Skip to content

Instantly share code, notes, and snippets.

@paulohenriquesn
Created May 15, 2019 07:31
Show Gist options
  • Save paulohenriquesn/7ba580e09ca43aeb4f6f2a45c33b9026 to your computer and use it in GitHub Desktop.
Save paulohenriquesn/7ba580e09ca43aeb4f6f2a45c33b9026 to your computer and use it in GitHub Desktop.
Array Extension
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;
}
}
@paulohenriquesn
Copy link
Author

paulohenriquesn commented May 15, 2019

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();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment