Record Detail

Compile Error

/in/ex3.c: In function 'ex3':
/in/ex3.c:14:14: warning: passing argument 1 of 'strlen' from incompatible pointer type [-Wincompatible-pointer-types]
     m=strlen(word);
              ^~~~
In file included from /in/ex3.c:3:0:
/usr/include/string.h:394:15: note: expected 'const char *' but argument is of type 'char **'
 extern size_t strlen (const char *__s)
               ^~~~~~
/in/ex3.c:16:55: warning: passing argument 1 of 'fw' from incompatible pointer type [-Wincompatible-pointer-types]
     printf("The string '%s' occurs %d times",*word,fw(line,word));
                                                       ^~~~
/in/ex3.c:5:5: note: expected 'char *' but argument is of type 'char **'
 int fw(char line[10000],char word[10000]);
     ^~
/in/ex3.c:16:60: warning: passing argument 2 of 'fw' from incompatible pointer type [-Wincompatible-pointer-types]
     printf("The string '%s' occurs %d times",*word,fw(line,word));
                                                            ^~~~
/in/ex3.c:5:5: note: expected 'char *' but argument is of type 'char **'
 int fw(char line[10000],char word[10000]);
     ^~
/in/ex3.c: At top level:
/in/ex3.c:25:5: error: conflicting types for 'fw'
 int fw(char *line[10000],char *word[10000]){
     ^~
/in/ex3.c:5:5: note: previous declaration of 'fw' was here
 int fw(char line[10000],char word[10000]);
     ^~
/in/ex3.c: In function 'fw':
/in/ex3.c:30:14: warning: passing argument 1 of 'strlen' from incompatible pointer type [-Wincompatible-pointer-types]
     L=strlen(line);
              ^~~~
In file included from /in/ex3.c:3:0:
/usr/include/string.h:394:15: note: expected 'const char *' but argument is of type 'char **'
 extern size_t strlen (const char *__s)
               ^~~~~~
/in/ex3.c:31:14: warning: passing argument 1 of 'strlen' from incompatible pointer type [-Wincompatible-pointer-types]
     w=strlen(word);
              ^~~~
In file included from /in/ex3.c:3:0:
/usr/include/string.h:394:15: note: expected 'const char *' but argument is of type 'char **'
 extern size_t strlen (const char *__s)
               ^~~~~~
/in/ex3.c:42:35: warning: comparison between pointer and integer
             if (flag2==w&&(line[i]<'a'||line[i]>'z')){flag++;}
                                   ^
/in/ex3.c:42:48: warning: comparison between pointer and integer
             if (flag2==w&&(line[i]<'a'||line[i]>'z')){flag++;}
                                                ^

Information

Submit By
Type
Submission
Homework
Assignment 5
Language
C
Submit At
2018-06-27 19:39:07
Judged At
2018-06-27 19:39:07
Judged By
Score
0
Total Time
0ms
Peak Memory
0 Bytes