Record Detail

Compile Error

/in/inDictionary.c: In function 'main':
/in/inDictionary.c:8:26: error: invalid initializer
     char Dictionary[100]=0;
                          ^
/in/inDictionary.c:9:19: error: invalid initializer
     int arr1[100]=0;
                   ^
/in/inDictionary.c:10:19: error: invalid initializer
     int arr2[100]=0;
                   ^
/in/inDictionary.c:11:20: error: comparison between pointer and integer [-Werror]
     while (*argv[i]!=NULL){
                    ^~
/in/inDictionary.c:13:20: error: passing argument 1 of 'strcmp' makes pointer from integer without a cast [-Werror=int-conversion]
         if (strcmp(argv[i][j],argv[i-1][j])){
                    ^~~~
In file included from /in/inDictionary.c:3:0:
/usr/include/string.h:136:12: note: expected 'const char *' but argument is of type 'char'
 extern int strcmp (const char *__s1, const char *__s2)
            ^~~~~~
/in/inDictionary.c:13:31: error: passing argument 2 of 'strcmp' makes pointer from integer without a cast [-Werror=int-conversion]
         if (strcmp(argv[i][j],argv[i-1][j])){
                               ^~~~
In file included from /in/inDictionary.c:3:0:
/usr/include/string.h:136:12: note: expected 'const char *' but argument is of type 'char'
 extern int strcmp (const char *__s1, const char *__s2)
            ^~~~~~
/in/inDictionary.c:16:27: error: passing argument 1 of 'strlen' makes pointer from integer without a cast [-Werror=int-conversion]
         for (j=0;j<strlen(*argv[i]);++j){
                           ^
In file included from /in/inDictionary.c:3:0:
/usr/include/string.h:384:15: note: expected 'const char *' but argument is of type 'char'
 extern size_t strlen (const char *__s)
               ^~~~~~
/in/inDictionary.c:16:19: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
         for (j=0;j<strlen(*argv[i]);++j){
                   ^
/in/inDictionary.c:26:31: error: passing argument 2 of 'strcat' makes pointer from integer without a cast [-Werror=int-conversion]
             strcat(Dictionary,argv[i][j]);
                               ^~~~
In file included from /in/inDictionary.c:3:0:
/usr/include/string.h:129:14: note: expected 'const char * restrict' but argument is of type 'char'
 extern char *strcat (char *__restrict __dest, const char *__restrict __src)
              ^~~~~~
/in/inDictionary.c:5:14: error: unused parameter 'argc' [-Werror=unused-parameter]
 int main(int argc, char *argv[]){
              ^~~~
cc1: all warnings being treated as errors

Information

Submit By
Type
Submission
Homework
Midterm Exam 2
Language
C
Submit At
2022-07-07 15:39:17
Judged At
2022-07-08 16:06:13
Judged By
Score
0
Total Time
0ms
Peak Memory
0 Bytes