记录详情

Compile Error

/in/foo.c:6:5: error: unknown type name 'Node'
     Node *lchild, *rchild;
     ^~~~
/in/foo.c:9:1: error: unknown type name 'Node'
 Node *createNode(int data) {
 ^~~~
/in/foo.c:9:1: note: use 'struct' keyword to refer to the type
/in/foo.c: In function 'createNode':
/in/foo.c:10:5: error: unknown type name 'Node'
     Node *node = new Node;
     ^~~~
/in/foo.c:10:5: note: use 'struct' keyword to refer to the type
/in/foo.c:10:18: error: 'new' undeclared (first use in this function)
     Node *node = new Node;
                  ^~~
/in/foo.c:10:18: note: each undeclared identifier is reported only once for each function it appears in
/in/foo.c:10:22: error: expected ',' or ';' before 'Node'
     Node *node = new Node;
                      ^~~~
/in/foo.c:11:9: error: request for member 'data' in something not a structure or union
     node->data = data;
         ^~
/in/foo.c:12:9: error: request for member 'lchild' in something not a structure or union
     node->lchild = node->rchild = NULL;
         ^~
/in/foo.c:12:24: error: request for member 'rchild' in something not a structure or union
     node->lchild = node->rchild = NULL;
                        ^~
/in/foo.c: At top level:
/in/foo.c:16:1: error: unknown type name 'Node'
 Node *insert(Node *root, int data) {
 ^~~~
/in/foo.c:16:1: note: use 'struct' keyword to refer to the type
/in/foo.c:16:14: error: unknown type name 'Node'
 Node *insert(Node *root, int data) {
              ^~~~
/in/foo.c:28:15: error: unknown type name 'Node'
 void PreOrder(Node *root) {
               ^~~~
/in/foo.c: In function 'main':
/in/foo.c:39:5: error: unknown type name 'Node'
     Node *root = NULL;
     ^~~~
/in/foo.c:39:5: note: use 'struct' keyword to refer to the type
/in/foo.c:43:16: warning: implicit declaration of function 'insert' [-Wimplicit-function-declaration]
         root = insert(root, num);
                ^~~~~~
/in/foo.c:43:14: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
         root = insert(root, num);
              ^
/in/foo.c:45:5: warning: implicit declaration of function 'PreOrder' [-Wimplicit-function-declaration]
     PreOrder(root);
     ^~~~~~~~

信息

递交者
类型
自测
语言
C
递交时间
2024-12-09 23:12:34
评测时间
2024-12-09 23:12:34
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes