|
Subject:
|
passing arraylist to functions
|
|
Posted By:
|
naqsh
|
Post Date:
|
8/10/2006 8:28:25 AM
|
Somebody please tell me that how could i send ArrayList as parameters to a function...
Asif Naqsh
|
|
Reply By:
|
.NETamateur
|
Reply Date:
|
8/15/2006 4:07:56 PM
|
If I understood you right you can just pass it like any other build-in types.
For example: Lets say that this is the function that you want to pass the ArrayList as a parameter to:
public void Example(ArrayList p_array_list) { // write the number of elements contained in the ArrayList p_array_list to the console Console.Write(p_array_list.Count); }
and this is for example your arraylist: ArrayList YourArrayList = new ArrayList(); YourArrayList.Add("My"); YourArrayList.Add("ArrayList");
Regards, .NETmateur Electrical Engineer
|