C#中作用域运行问题 在线等 多给分啊

来源:百度知道 编辑:UC知道 时间:2024/09/22 01:09:46
using System;
using System.Collections.Generic;
using System.Text;
using System.Collections;
namespace ConsoleApplication4
{

class program
{
static int bdd( out int f)
{
f = 2;
return f;
}

static void Main(string[] args)
{
int l;
ArrayList myArrayList = new ArrayList(bdd(out l));
for (int i = 0; i < 10; i++)
{
myArrayList.Add(i);
}
myArrayList.Insert(5, 88889);
myArrayList.Remove(4);
Console.WriteLine(myArrayList);
for (int j = 0; j < myArrayList.Count; j++)
{
int number = (int)myArrayList[j];
Console.WriteLine(number);
}
}

}
}

源代码如上

你的程序我试过了,运行没问题.......
报错的原因很难说清楚...不过很有可能是因为与其他的程序冲突了
我建议在单独的文件夹内重新建一个程序,为程序命下名,再把代码复制进去试下.....

把你的Application5从项目中去除。