Record Detail

Compile Error

/in/ex6.cpp: In member function 'int BinaryTree::sum() const':
/in/ex6.cpp:45:21: error: 'rightSum' was not declared in this scope
     int sumOfTree = rightSum = leftSum = 0;
                     ^~~~~~~~
/in/ex6.cpp:45:32: error: 'leftSum' was not declared in this scope
     int sumOfTree = rightSum = leftSum = 0;
                                ^~~~~~~
/in/ex6.cpp:58:9: error: redeclaration of 'int sumOfTree'
     int sumOfTree = root->val + leftSum + rightSum;
         ^~~~~~~~~
/in/ex6.cpp:45:9: note: 'int sumOfTree' previously declared here
     int sumOfTree = rightSum = leftSum = 0;
         ^~~~~~~~~
/in/ex6.cpp: In member function 'int BinaryTree::depth() const':
/in/ex6.cpp:81:5: error: expected ',' or ';' before 'std'
     std::cout << depthOfTree;
     ^~~
/in/compile/Makefile:69: recipe for target 'ex6.o' failed
make: *** [ex6.o] Error 1

Information

Submit By
Type
Submission
Homework
Exercise 6
Language
C++
Submit At
2024-12-22 19:10:13
Judged At
2024-12-22 19:10:13
Judged By
Score
0
Total Time
0ms
Peak Memory
0 Bytes