Record Detail

Compile Error

/in/cipher.cpp: In function 'std::__cxx11::string encrypt(std::__cxx11::string, bool)':
/in/cipher.cpp:35:26: error: comparison with string literal results in unspecified behavior [-Werror=address]
           if(message[i]=="J"){
                          ^~~
/in/cipher.cpp:35:26: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
/in/cipher.cpp:36:19: error: 'append' was not declared in this scope
            result,append("100")
                   ^~~~~~
/in/cipher.cpp:36:19: note: suggested alternative: 'popen'
            result,append("100")
                   ^~~~~~
                   popen
/in/cipher.cpp:38:20: error: comparison with string literal results in unspecified behavior [-Werror=address]
     if(message[i]=="j"){
                    ^~~
/in/cipher.cpp:38:20: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
/in/cipher.cpp:39:19: error: 'append' was not declared in this scope
            result,append("200")
                   ^~~~~~
/in/cipher.cpp:39:19: note: suggested alternative: 'popen'
            result,append("200")
                   ^~~~~~
                   popen
/in/cipher.cpp: In function 'std::__cxx11::string decrypt(std::__cxx11::string, bool)':
/in/cipher.cpp:59:38: error: comparison of constant ''0'' with boolean expression is always false [-Werror=bool-compare]
        if (message[i+1]==message[i+2]=='0'){
/in/cipher.cpp:59:24: error: suggest parentheses around comparison in operand of '==' [-Werror=parentheses]
        if (message[i+1]==message[i+2]=='0'){
/in/cipher.cpp:61:3: error: expected ';' before '}' token
   }else{
   ^
/in/cipher.cpp:66:38: error: comparison of constant ''0'' with boolean expression is always false [-Werror=bool-compare]
        if (message[i+1]==message[i+2]=='0'){
/in/cipher.cpp:66:24: error: suggest parentheses around comparison in operand of '==' [-Werror=parentheses]
        if (message[i+1]==message[i+2]=='0'){
/in/cipher.cpp:68:3: error: expected ';' before '}' token
   }else{
   ^
/in/cipher.cpp:77:1: error: expected '}' at end of input
 }
 ^
/in/cipher.cpp:77:1: error: expected '}' at end of input
/in/cipher.cpp:77:1: error: control reaches end of non-void function [-Werror=return-type]
 }
 ^
cc1plus: all warnings being treated as errors
/in/compile/Makefile:23: recipe for target 'cipher.o' failed
make: *** [cipher.o] Error 1

Information

Submit By
Type
Submission
Homework
Exercise 3
Language
C++
Submit At
2024-11-03 23:58:40
Judged At
2024-11-03 23:58:40
Judged By
Score
0
Total Time
0ms
Peak Memory
0 Bytes