|
-
Mar 28th, 2006, 09:38 AM
#1
Thread Starter
Hyperactive Member
Using foreach with an ArrayList
hi. I'm trying to use the foreach statement with the ArrayList. Here is a sample of my code:
ArrayList AList = new ArrayList();
AList.Add("hi");
AList.Add("ko");
AList.Add("dr");
AList.Add("cvdf");
foreach(int x in AList)
{
// some code
}
I'm getting an invalid cast exception. Anyone knows why? - Jennifer
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|