Adding to the end of an ArrayList : ArrayList « Collections « Visual C++ .NET






Adding to the end of an ArrayList

 
#include "stdafx.h"

using namespace System;
using namespace System::Collections;



void main()
{
    ArrayList ^alist = gcnew ArrayList(4); // will double to 8
    alist->Add("One");
    alist->Add("-");
    alist[1] = "Three";


}

   
  








Related examples in the same category

1.Sort an ArrayList
2.Adding value to ArrayList with Indexer
3.Insert value to an ArrayList at specified position
4.Using AddRange to add an array of value to ArrayList
5.Reverse the values in an ArrayList
6.Using for loop the display elements in an ArrayList
7.Get the capacity of an ArrayList
8.Set the capacity
9.Get the element count
10.Does an ArrayList contain a value
11.Sort an ArrayList by functor
12.Binary search an ArrayList by functor
13.Adding strings to ArrayList
14.Iterate ArrayList using indexing
15.Iterate ArrayList using the for each operator