Hi guys I wrote this code and i have two errors.
- Invalid rank specifier: expected ',' or ']'
- Cannot apply indexing with [] to an expression of type 'int'
Can you help please?
static void Main(string[] args)
{
ArrayList numbers = new ArrayList();
foreach (int number in new int[12] {10,9,8,7,6,5,4,3,2,1}) //error No.1
{
numbers.Add(number);
}
numbers.Insert(numbers.Count - 1, 75);
numbers.Remove(7);
numbers.RemoveAt(6);
for(int i=0; i<numbers.Count; i++)
{
int number = (int) number[i]; // error No.2
Console.WriteLine(number);
}
}