Record Detail

Compile Error

/in/ex3.cpp: In function 'int main(int, char**)':
/in/ex3.cpp:18:17: error: comparison with string literal results in unspecified behavior [-Werror=address]
     if(argv[2]!="-s" && argv[2]!="--sparse" && argv[2]!="--compact" && argv[2]!="-c" && argv[2]!=" " && command1!="-d"&& command1!="--decrypt" && command1!="-h"&&command1!="--help" && command1!="-e"&& command1!="----encrypt")
                 ^~~~
/in/ex3.cpp:18:34: error: comparison with string literal results in unspecified behavior [-Werror=address]
     if(argv[2]!="-s" && argv[2]!="--sparse" && argv[2]!="--compact" && argv[2]!="-c" && argv[2]!=" " && command1!="-d"&& command1!="--decrypt" && command1!="-h"&&command1!="--help" && command1!="-e"&& command1!="----encrypt")
                                  ^~~~~~~~~~
/in/ex3.cpp:18:57: error: comparison with string literal results in unspecified behavior [-Werror=address]
     if(argv[2]!="-s" && argv[2]!="--sparse" && argv[2]!="--compact" && argv[2]!="-c" && argv[2]!=" " && command1!="-d"&& command1!="--decrypt" && command1!="-h"&&command1!="--help" && command1!="-e"&& command1!="----encrypt")
                                                         ^~~~~~~~~~~
/in/ex3.cpp:18:81: error: comparison with string literal results in unspecified behavior [-Werror=address]
     if(argv[2]!="-s" && argv[2]!="--sparse" && argv[2]!="--compact" && argv[2]!="-c" && argv[2]!=" " && command1!="-d"&& command1!="--decrypt" && command1!="-h"&&command1!="--help" && command1!="-e"&& command1!="----encrypt")
                                                                                 ^~~~
/in/ex3.cpp:18:98: error: comparison with string literal results in unspecified behavior [-Werror=address]
     if(argv[2]!="-s" && argv[2]!="--sparse" && argv[2]!="--compact" && argv[2]!="-c" && argv[2]!=" " && command1!="-d"&& command1!="--decrypt" && command1!="-h"&&command1!="--help" && command1!="-e"&& command1!="----encrypt")
                                                                                                  ^~~
/in/ex3.cpp:28:22: error: comparison with string literal results in unspecified behavior [-Werror=address]
         if (argv[2]=="--compact" || argv[2]=="-c"){
                      ^~~~~~~~~~~
/in/ex3.cpp:28:46: error: comparison with string literal results in unspecified behavior [-Werror=address]
         if (argv[2]=="--compact" || argv[2]=="-c"){
                                              ^~~~
/in/ex3.cpp:32:27: error: comparison with string literal results in unspecified behavior [-Werror=address]
         }else if(argv[2]=="--sparse" || argv[2]=="-s"){
                           ^~~~~~~~~~
/in/ex3.cpp:32:50: error: comparison with string literal results in unspecified behavior [-Werror=address]
         }else if(argv[2]=="--sparse" || argv[2]=="-s"){
                                                  ^~~~
/in/ex3.cpp:40:22: error: comparison with string literal results in unspecified behavior [-Werror=address]
         if (argv[2]=="--compact" || argv[2]=="-c"){
                      ^~~~~~~~~~~
/in/ex3.cpp:40:46: error: comparison with string literal results in unspecified behavior [-Werror=address]
         if (argv[2]=="--compact" || argv[2]=="-c"){
                                              ^~~~
/in/ex3.cpp:44:27: error: comparison with string literal results in unspecified behavior [-Werror=address]
         }else if(argv[2]=="--sparse" || argv[2]=="-s"){
                           ^~~~~~~~~~
/in/ex3.cpp:44:50: error: comparison with string literal results in unspecified behavior [-Werror=address]
         }else if(argv[2]=="--sparse" || argv[2]=="-s"){
                                                  ^~~~
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-03 13:45:18
Judged At
2024-11-03 13:45:18
Judged By
Score
0
Total Time
0ms
Peak Memory
0 Bytes