请教为什么c#中list无法添加

请教为什么c#中list无法添加

问题描述:

首先,我定义了一个三维点的结构体
public struct thrDemPoint
{
public int id;
public float x;
public float y;
public float z;
public thrDemPoint(int ID, float X, float Y, float Z)
{
id = ID;
x = X;
y = Y;
z = Z;
}
}//点结构

然后,定义了一个List以及一个点
List thrDemPoints = new List();
thrDemPoint p1 = new thrDemPoint(1, 0, 0, 0);

但是,向list中
thrDemPoints.Add(p1);
是无效的,萌新请问为什么...

thrDemPoint p1 = new thrDemPoint(1.0f, 0.0f, 0.0f, 0.0f);

thrDemPoints.Add(p1);
下面这行是对的

还是没有解决,错误信息是 类、结构或借口成员声名中的标记括号无效。

想知道最后解决了吗,,,