1
Reply

array problem

Kelvin Loke

Kelvin Loke

Jun 1 2007 9:38 AM
1.8k
Hi,I´m new with C# and I need to create a global array, but I´m doing something wrong.. This is how I create the global array.. public class MyClass { int i = 0; int[] vrgb = new int[3000]; public static int[] RGB { get { return vrgb[i]; } set { vrgb[i] = value; } } } This is how I call it: int i; i = Program.Indice; int[] contenedor; contenedor = RGBvector.MyClass.RGB; contenedor[i] = ValorRojo; RGBvector.MyClass.RGB = contenedor[i]; note that Valor rojo = int. can anyone help me? the errors I get are: 1.cannot implicitly covert int to int[] 2.Error 4 An object reference is required for the nonstatic field, method, or property 'RGBvector.MyClass.vrgb' Thank you very much.

Answers (1)
Next Recommended Forum