为什么在struct中使用struct array时会出错?
public struct Tables
{
public string name;
}
public struct Schema
{
public string name;
public Tables[] tables; //Declarate struct array in struct
}
我在这段代码中使用了 struct:
Schema schema;
private void Form1_Load(object sender, EventArgs e)
{
schema.name = "schemaName";
schema.tables[0].name = "tables1Name"; // Error in here: Object reference not set to an instance of an object
}