1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

indexers and arrays

Discussion in 'C#' started by sclement, Oct 3, 2010.

  1. sclement

    sclement New Member

    Joined:
    Oct 3, 2010
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    Hi

    I have a class which has several members which are arrays of doubles. I am trying to figure out the best way to access these arrays.

    Is it best to use properties:

    private static double[] _dcount = new double[20];

    public static double [] _dcount
    {
    get { return _dcount; }
    set { _dcount = value; }
    }

    or to write accessor functions ?

    I thought about using indexers, but if I am reading my books correctly they won't work if there are several arrays of the same type in the class.

    Any help would be appreciated

    cheers

    simon
     

Share This Page