C#中索引跟數組的比較

索引跟數組的比較

•       索引和數組的比較 
       索引可以使用非整型參數
       索引可以被重載
       索引可以是私有的
       索引不能有ref/out 型參數
struct Matrix
{
    ...
    public double this [int row, int col]
    {  
        get { ... }
        set { ... }
    }
    public Row this [int row]
    {  
        get { ... }
        set { ... }
    }
    ...
}

推薦閱讀:http://www.taoche.com/buycar/serial/dibadaiyage/

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章