Record Detail

Compile Error

/in/ex3.cpp: In function 'int main(int, char**)':
/in/ex3.cpp:30:45: error: comparison with string literal results in unspecified behavior [-Werror=address]
     if(std::string(argv[1])=="-h"||argv[1]=="help"){
                                             ^~~~~~
/in/ex3.cpp:38:46: error: comparison with string literal results in unspecified behavior [-Werror=address]
      if(std::string(argv[1])=="-e"||argv[1]=="--encrypt"){
                                              ^~~~~~~~~~~
/in/ex3.cpp:41:51: error: comparison with string literal results in unspecified behavior [-Werror=address]
      else if(std::string(argv[1])=="-d"||argv[1]=="--decrypt"){ mode=2;}
                                                   ^~~~~~~~~~~
/in/ex3.cpp:44:44: error: comparison with string literal results in unspecified behavior [-Werror=address]
    if(std::string(argv[2])=="-c"||argv[2]=="--compact"){upp=1;}
                                            ^~~~~~~~~~~
/in/ex3.cpp:45:49: error: comparison with string literal results in unspecified behavior [-Werror=address]
    else if(std::string(argv[2])=="-s"||argv[2]=="--sqarse"){ upp=2; }
                                                 ^~~~~~~~~~
cc1plus: all warnings being treated as errors
/in/compile/Makefile:20: recipe for target 'ex3.o' failed
make: *** [ex3.o] Error 1

Information

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