opensubscriber
   Find in this group all groups
 
Unknown more information…

d : dotnet-winforms@discuss.develop.com 22 June 2008 • 7:19AM -0400

Re: Arrays as parameters
by Chris Anderson

REPLY TO AUTHOR
 
REPLY TO GROUP




> How does one do the following:
>
> Class Someclass{
>
>         Private string [] myarray;
>
>         Public string [] MyArray {get { return myarray[];}
> set{myarray[]=
> value;}}
> }
> Correctly? I want to be able to declare this class in my main function
> and
> set the parameters of the myarray as
>
> Someclass Sc = new someclass;
> Sc.MyArray[0] = "This is test 1";
> Sc.MyArray[1] = "Thisis test 2";
> Etc...




class Someclass{
        private string[] myarray;

        public string[] MyArray {
                get {
                        return myarray;
                }
                set{
                        myarray= value;
                }
        }
}

Bookmark with:

Delicious   Digg   reddit   Facebook   StumbleUpon

opensubscriber is not affiliated with the authors of this message nor responsible for its content.