Record Detail

Compile Error

/in/ex3.cpp: In function 'int main(int, char**)':
/in/ex3.cpp:59:18: error: comparison with string literal results in unspecified behavior [-Werror=address]
     if((argv[1]=="-h"||argv[1]=="--help")&&argc==3)
                  ^~~~
/in/ex3.cpp:59:33: error: comparison with string literal results in unspecified behavior [-Werror=address]
     if((argv[1]=="-h"||argv[1]=="--help")&&argc==3)
                                 ^~~~~~~~
/in/ex3.cpp:64:17: error: comparison with string literal results in unspecified behavior [-Werror=address]
     if(argv[1]=="-h"||argv[1]=="--help")
                 ^~~~
/in/ex3.cpp:64:32: error: comparison with string literal results in unspecified behavior [-Werror=address]
     if(argv[1]=="-h"||argv[1]=="--help")
                                ^~~~~~~~
/in/ex3.cpp:69:17: error: comparison with string literal results in unspecified behavior [-Werror=address]
     if(argv[1]!="-h"&&argv[1]!="-e"&&argv[1]!="-d"&&argv[1]!="--encrypt"&&argv[1]!="--decrypt"&&argv[1]!="--help")
                 ^~~~
/in/ex3.cpp:69:32: error: comparison with string literal results in unspecified behavior [-Werror=address]
     if(argv[1]!="-h"&&argv[1]!="-e"&&argv[1]!="-d"&&argv[1]!="--encrypt"&&argv[1]!="--decrypt"&&argv[1]!="--help")
                                ^~~~
/in/ex3.cpp:69:47: error: comparison with string literal results in unspecified behavior [-Werror=address]
     if(argv[1]!="-h"&&argv[1]!="-e"&&argv[1]!="-d"&&argv[1]!="--encrypt"&&argv[1]!="--decrypt"&&argv[1]!="--help")
                                               ^~~~
/in/ex3.cpp:69:62: error: comparison with string literal results in unspecified behavior [-Werror=address]
     if(argv[1]!="-h"&&argv[1]!="-e"&&argv[1]!="-d"&&argv[1]!="--encrypt"&&argv[1]!="--decrypt"&&argv[1]!="--help")
                                                              ^~~~~~~~~~~
/in/ex3.cpp:69:84: error: comparison with string literal results in unspecified behavior [-Werror=address]
     if(argv[1]!="-h"&&argv[1]!="-e"&&argv[1]!="-d"&&argv[1]!="--encrypt"&&argv[1]!="--decrypt"&&argv[1]!="--help")
                                                                                    ^~~~~~~~~~~
/in/ex3.cpp:69:106: error: comparison with string literal results in unspecified behavior [-Werror=address]
     if(argv[1]!="-h"&&argv[1]!="-e"&&argv[1]!="-d"&&argv[1]!="--encrypt"&&argv[1]!="--decrypt"&&argv[1]!="--help")
                                                                                                          ^~~~~~~~
/in/ex3.cpp:74:26: error: comparison with string literal results in unspecified behavior [-Werror=address]
     if(argc==3&&argv[2]!="-h"&&argv[2]!="-e"&&argv[2]!="-d"&&argv[2]!="--encrypt")
                          ^~~~
/in/ex3.cpp:74:41: error: comparison with string literal results in unspecified behavior [-Werror=address]
     if(argc==3&&argv[2]!="-h"&&argv[2]!="-e"&&argv[2]!="-d"&&argv[2]!="--encrypt")
                                         ^~~~
/in/ex3.cpp:74:56: error: comparison with string literal results in unspecified behavior [-Werror=address]
     if(argc==3&&argv[2]!="-h"&&argv[2]!="-e"&&argv[2]!="-d"&&argv[2]!="--encrypt")
                                                        ^~~~
/in/ex3.cpp:74:71: error: comparison with string literal results in unspecified behavior [-Werror=address]
     if(argc==3&&argv[2]!="-h"&&argv[2]!="-e"&&argv[2]!="-d"&&argv[2]!="--encrypt")
                                                                       ^~~~~~~~~~~
/in/ex3.cpp:80:27: error: comparison with string literal results in unspecified behavior [-Werror=address]
     if(argc==3&&(argv[2]=="-s"||argv[2]=="--sparse"))
                           ^~~~
/in/ex3.cpp:80:42: error: comparison with string literal results in unspecified behavior [-Werror=address]
     if(argc==3&&(argv[2]=="-s"||argv[2]=="--sparse"))
                                          ^~~~~~~~~~
/in/ex3.cpp:84:17: error: comparison with string literal results in unspecified behavior [-Werror=address]
     if(argv[1]=="-e")
                 ^~~~
/in/ex3.cpp:100:17: error: comparison with string literal results in unspecified behavior [-Werror=address]
     if(argv[1]=="-d")
                 ^~~~
/in/ex3.cpp: In function 'std::__cxx11::string rad(char)':
/in/ex3.cpp:35:1: error: control reaches end of non-void function [-Werror=return-type]
 }
 ^
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-06 23:56:09
Judged At
2024-11-06 23:56:09
Judged By
Score
0
Total Time
0ms
Peak Memory
0 Bytes