HELP~关于string数组的菜鸟问题 ……
using System;
namespace test
{
class Class1
{
public static string[] s;
[STAThread]
static void Main(string[] args)
{
s[0] = Console.ReadLine();
Console.WriteLine(s[0].ToString());
}
}
}
执行的时候,输入一个字符,然后提示出错:未将对象引用设置到对象的实例
希望各位指教,这是为什么呢?
小弟想实现,不定义String数组的长度,动态给该数组赋值,比如:
string [] s;
for(i = 0;1 < n;i ++)
{
s[i] = "ttt";
}
这样可以么?
谢谢先