Search This Blog

Tuesday, July 16, 2013

Square brackets ([]) operator C#

C# > Operators > [] Operator 

Square brackets ([]) operator is used for arrays, indexers, and attributes.

Examples
 //arrays
  int[] mList;
  mList = new int[200];

 //indexers
  System.Collections.Hashtable h = new System.Collections.Hashtable();
  h["e1"] = 1;
      
  //attributes
  [System.Serializable]