Record Detail

Compile Error

/in/node.cpp: In function 'int equalhelper(Node*, Node*)':
/in/node.cpp:20:15: error: 'int Node::value' is protected within this context
     if (root->value != sub->value) return 0;
               ^~~~~
In file included from /in/node.cpp:1:0:
/in/driver/node.h:14:9: note: declared protected here
     int value;      // the integer value of this
         ^~~~~
/in/node.cpp:20:29: error: 'int Node::value' is protected within this context
     if (root->value != sub->value) return 0;
                             ^~~~~
In file included from /in/node.cpp:1:0:
/in/driver/node.h:14:9: note: declared protected here
     int value;      // the integer value of this
         ^~~~~
/in/node.cpp:21:15: error: 'int Node::child_num' is protected within this context
     if (root->child_num != sub->child_num) return 0;
               ^~~~~~~~~
In file included from /in/node.cpp:1:0:
/in/driver/node.h:15:9: note: declared protected here
     int child_num;  // the number of child of this
         ^~~~~~~~~
/in/node.cpp:21:33: error: 'int Node::child_num' is protected within this context
     if (root->child_num != sub->child_num) return 0;
                                 ^~~~~~~~~
In file included from /in/node.cpp:1:0:
/in/driver/node.h:15:9: note: declared protected here
     int child_num;  // the number of child of this
         ^~~~~~~~~
/in/node.cpp:23:26: error: 'int Node::child_num' is protected within this context
     for (int i=0;i<root->child_num;i++)
                          ^~~~~~~~~
In file included from /in/node.cpp:1:0:
/in/driver/node.h:15:9: note: declared protected here
     int child_num;  // the number of child of this
         ^~~~~~~~~
/in/node.cpp:24:40: error: 'Node** Node::children' is protected within this context
         following *= equalhelper(root->children[i],sub->children[i]);
                                        ^~~~~~~~
In file included from /in/node.cpp:1:0:
/in/driver/node.h:18:12: note: declared protected here
     Node **children;
            ^~~~~~~~
/in/node.cpp:24:57: error: 'Node** Node::children' is protected within this context
         following *= equalhelper(root->children[i],sub->children[i]);
                                                         ^~~~~~~~
In file included from /in/node.cpp:1:0:
/in/driver/node.h:18:12: note: declared protected here
     Node **children;
            ^~~~~~~~
/in/node.cpp: In destructor 'Node::~Node()':
/in/node.cpp:45:5: error: this 'for' clause does not guard... [-Werror=misleading-indentation]
     for (int i=0;i<child_num;i++);
     ^~~
/in/node.cpp:46:6: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
      delete children[i];
      ^~~~~~
/in/node.cpp:46:22: error: 'i' was not declared in this scope
      delete children[i];
                      ^
cc1plus: all warnings being treated as errors

Information

Submit By
Type
Submission
Homework
Lab8
Language
C++
Submit At
2021-07-12 17:43:09
Judged At
2021-07-16 17:36:51
Judged By
Score
0
Total Time
0ms
Peak Memory
0 Bytes