我创建了2个struct dl和Node.我使用struct dl来创建Node并创建了函数MakeNode.请帮帮我!谢谢你们看了.
typedef struct _dl {
char ProblemID[10];
char TimePoint[20];
char Status[10];
int Point;
} dl;
typedef struct _Node {
dl x;
struct _Node* leftChild;
struct _Node* rightChild;
} Node;
void cpy(dl x, dl a) {
strcpy(x.ProblemID, a.ProblemID);
strcpy(x.TimePoint, a.TimePoint);
strcpy(x.Status, a.Status);
x.Point = a.Point;
printf("%s %s %s %d\n",x.ProblemID,x.TimePoint,x.Status,x.Point);
}
Node* makeNode(dl a) {
Node* p = (Node*)malloc(sizeof(Node));
if (p == NULL) {
exit(1);
}
cpy(p->x, a);
printf("%s %s %s %d\n",p->x.ProblemID,p->x.TimePoint,p->x.Status,p->x.Point);
p->leftChild = NULL;
p->rightChild = NULL;
return p;
}
你能指出我的错误吗?谢谢大家.