Re: Arrays as parameters

Chris Anderson <[email protected]> Sun, 22 Jun 2008 00:19:14 +0100
Newsgroups gmane.comp.windows.devel.dotnet.winforms
Message-ID <[email protected]>
> How does one do the following:
>=20
> Class Someclass{
>=20
>         Private string [] myarray;
>=20
>         Public string [] MyArray {get { return myarray[];}
> set{myarray[]=3D
> value;}}
> }
> Correctly? I want to be able to declare this class in my main function
> and
> set the parameters of the myarray as
>=20
> Someclass Sc =3D new someclass;
> Sc.MyArray[0] =3D "This is test 1";
> Sc.MyArray[1] =3D "Thisis test 2";
> Etc...




class Someclass{
        private string[] myarray;
=20
        public string[] MyArray {
                get {=20
                        return myarray;
                }
                set{
                        myarray=3D value;
                }
        }
 }