I was working with a array in C# and I want it to have its default values again i tried creating a second array as following:
static readonly int[] defmenuItemsParInt = { 60, 60, 0 };
static int[] menuItemsParInt = defmenuItemsParInt;
for some reason this changed the default array aswell so i tried:
static int[] menuItemsParInt = { 60, 60, 0 };
static readonly int[] defmenuItemsParInt = menuItemsParInt;
(the arrays are declared above the main class)
both I used my reset function:
static void reset()
{
menuItemsParInt = defmenuItemsParInt;
}
these methods didnt work is there a easier method or am i doing something wrong?