Using AddRange to add an array of value to ArrayList : ArrayList « Collections « Visual C++ .NET

Home
Visual C++ .NET
1.2D
2.Class
3.Collections
4.Data Type
5.Database ADO.net
6.Delegate
7.Development
8.File Directory
9.Function
10.Generics
11.GUI Form
12.Language Basics
13.Network
14.Reflection
15.Security
16.Statement
17.Structure
18.Thread
19.XML
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Visual C++ .NET » Collections » ArrayList 
Using AddRange to add an array of value to 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("-");
    array<String^>^ morenums = gcnew array<String^> {"Four""Five"};

    alist->AddRange(morenums);

}

   
  
Related examples in the same category
1.Sort an ArrayList
2.Adding to the end of an ArrayList
3.Adding value to ArrayList with Indexer
4.Insert value to an ArrayList at specified position
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
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.