declaring arraylist  
Author Message
Nisa





PostPosted: Visual C++ Express Edition, declaring arraylist Top

How do i declare a arraylist variable in c++/cli. and i need to initialise 10 elements in it. How is done and how am i to get the value and gcnew it to array

Visual Studio Express Editions36  
 
 
Student417





PostPosted: Visual C++ Express Edition, declaring arraylist Top

int a[3]={0,0,0};

a is variable name. To retrieve it

a[0] is get element 1

a[1] is to get element 2;

a[2] is to get element 3;

a[3] declares end of array.


 
 
Nisa





PostPosted: Visual C++ Express Edition, declaring arraylist Top

Hi thanks for the infor. But i need to use arraylist to do.. not arrays. is it ok if can help out
 
 
Peter-Michael Osera - MSFT





PostPosted: Visual C++ Express Edition, declaring arraylist Top

In .NET, the List<T> class is the generic equivalent of the older, non-generic, ArrayList class. You can check out the MSDN documentation for more information about the class. The topic for List has a fairly comprehensive sample in it that will answer your questions regarding initialization and access.