Record Detail

Compile Error

/in/calc.cpp:139:33: error: reference to 'minus' is ambiguous
                operate(stack,2,minus);
                                ^
/in/calc.cpp:30:6: note: candidate found by name lookup is 'minus'
void minus(Dlist<int> &stack){
     ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/bits/stl_function.h:177:12: note: candidate found by name lookup is 'std::minus'
    struct minus : public binary_function<_Tp, _Tp, _Tp>
           ^
/in/calc.cpp:148:33: error: reference to 'negate' is ambiguous
                operate(stack,1,negate);
                                ^
/in/calc.cpp:69:6: note: candidate found by name lookup is 'negate'
void negate(Dlist<int> &stack){
     ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/bits/stl_function.h:217:12: note: candidate found by name lookup is 'std::negate'
    struct negate : public unary_function<_Tp, _Tp>
           ^
/in/calc.cpp:160:23: error: cannot refer to class template 'Dlist' without a template argument list
                stack=Dlist();
                      ^
/in/Compile/dlist.h:10:7: note: template is declared here
class Dlist
      ^
/in/calc.cpp:174:22: error: value of type 'const char [2]' is not implicitly convertible to 'int'
                case "q":
                     ^~~
/in/calc.cpp:162:22: error: value of type 'const char [2]' is not implicitly convertible to 'int'
                case "a":
                     ^~~
/in/calc.cpp:159:22: error: value of type 'const char [2]' is not implicitly convertible to 'int'
                case "c":
                     ^~~
/in/calc.cpp:156:22: error: value of type 'const char [2]' is not implicitly convertible to 'int'
                case "p":
                     ^~~
/in/calc.cpp:153:22: error: value of type 'const char [2]' is not implicitly convertible to 'int'
                case "r":
                     ^~~
/in/calc.cpp:150:22: error: value of type 'const char [2]' is not implicitly convertible to 'int'
                case "d":
                     ^~~
/in/calc.cpp:147:22: error: value of type 'const char [2]' is not implicitly convertible to 'int'
                case "n":
                     ^~~
/in/calc.cpp:144:22: error: value of type 'const char [2]' is not implicitly convertible to 'int'
                case "/":
                     ^~~
/in/calc.cpp:141:22: error: value of type 'const char [2]' is not implicitly convertible to 'int'
                case "*":
                     ^~~
/in/calc.cpp:138:22: error: value of type 'const char [2]' is not implicitly convertible to 'int'
                case "-":
                     ^~~
/in/calc.cpp:135:22: error: value of type 'const char [2]' is not implicitly convertible to 'int'
                case "+":
                     ^~~
/in/calc.cpp:133:13: error: cannot jump from switch statement to this case label
            case 1:
            ^
/in/calc.cpp:129:18: note: jump bypasses variable initialization
            int *num=new int;
                 ^
15 errors generated.
/in/Compile/Makefile:44: recipe for target 'buildCalc' failed
make: *** [buildCalc] Error 1

Information

Submit By
Type
Submission
Homework
Project5
Language
C++
Submit At
2024-04-29 21:01:01
Judged At
2024-04-29 21:01:01
Judged By
Score
0
Total Time
0ms
Peak Memory
0 Bytes