Record Detail

Compile Error

/in/ex3.cpp: In function 'int main(int, char**)':
/in/ex3.cpp:60:18: error: comparison with string literal results in unspecified behavior [-Werror=address]
     if((argv[1]=="-h"||argv[1]=="--help")&&argc==3)
                  ^~~~
/in/ex3.cpp:60:33: error: comparison with string literal results in unspecified behavior [-Werror=address]
     if((argv[1]=="-h"||argv[1]=="--help")&&argc==3)
                                 ^~~~~~~~
/in/ex3.cpp:65:17: error: comparison with string literal results in unspecified behavior [-Werror=address]
     if(argv[1]=="-h"||argv[1]=="--help")
                 ^~~~
/in/ex3.cpp:65:32: error: comparison with string literal results in unspecified behavior [-Werror=address]
     if(argv[1]=="-h"||argv[1]=="--help")
                                ^~~~~~~~
/in/ex3.cpp:70: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:70: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:70: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:70: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:70: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:70: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:75: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:75: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:75: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:75: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:81:27: error: comparison with string literal results in unspecified behavior [-Werror=address]
     if(argc==3&&(argv[2]=="-s"||argv[2]=="--sparse"))
                           ^~~~
/in/ex3.cpp:81:42: error: comparison with string literal results in unspecified behavior [-Werror=address]
     if(argc==3&&(argv[2]=="-s"||argv[2]=="--sparse"))
                                          ^~~~~~~~~~
/in/ex3.cpp:85:17: error: comparison with string literal results in unspecified behavior [-Werror=address]
     if(argv[1]=="-e")
                 ^~~~
/in/ex3.cpp:101:17: error: comparison with string literal results in unspecified behavior [-Werror=address]
     if(argv[1]=="-d")
                 ^~~~
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:58:05
Judged At
2024-11-08 11:32:44
Judged By
Score
0
Total Time
0ms
Peak Memory
0 Bytes