My code currently resembles this:
private static readonly int[] INTARRAY = {1, 2, 3};
This does not allow me to assign INTARRAYto a new instance int[]outside the static constructor, but it still allows me to assign individual elements int.
For instance:
INTARRAY[1] = 5;
How can I make this array fully read-only? This is an array of value types and is assigned by the array initializer in the declaration. How can I make these initial values persist indefinitely?
source
share