Record Detail

Compile Error

/in/inDictionary.c: In function 'inDictionary':
/in/inDictionary.c:11:10: error: 'CHar' redeclared as different kind of symbol
     char CHar[],collect[],Memory[];
          ^~~~
/in/inDictionary.c:9:24: note: previous definition of 'CHar' was here
 int inDictionary(char *CHar){
                        ^~~~
/in/inDictionary.c:11:10: error: array size missing in 'CHar'
     char CHar[],collect[],Memory[];
          ^~~~
/in/inDictionary.c:11:17: error: array size missing in 'collect'
     char CHar[],collect[],Memory[];
                 ^~~~~~~
/in/inDictionary.c:11:27: error: array size missing in 'Memory'
     char CHar[],collect[],Memory[];
                           ^~~~~~
/in/inDictionary.c:12:24: error: passing argument 1 of 'strlen' makes pointer from integer without a cast [-Werror=int-conversion]
     for (i=0;i<=strlen(*CHar);i++){
                        ^
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:12:15: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
     for (i=0;i<=strlen(*CHar);i++){
               ^~
/in/inDictionary.c:14:24: error: 'Char' undeclared (first use in this function); did you mean 'CHar'?
             collect[i]=Char[i];
                        ^~~~
                        CHar
/in/inDictionary.c:14:24: note: each undeclared identifier is reported only once for each function it appears in
/in/inDictionary.c:18:25: error: passing argument 1 of 'strchr' from incompatible pointer type [-Werror=incompatible-pointer-types]
             if ( strchr(&Memory,"%s",CHar[i])==collect){
                         ^
In file included from /in/inDictionary.c:3:0:
/usr/include/string.h:225:14: note: expected 'const char *' but argument is of type 'char (*)[1]'
 extern char *strchr (const char *__s, int __c)
              ^~~~~~
/in/inDictionary.c:18:33: error: passing argument 2 of 'strchr' makes integer from pointer without a cast [-Werror=int-conversion]
             if ( strchr(&Memory,"%s",CHar[i])==collect){
                                 ^~~~
In file included from /in/inDictionary.c:3:0:
/usr/include/string.h:225:14: note: expected 'int' but argument is of type 'char *'
 extern char *strchr (const char *__s, int __c)
              ^~~~~~
/in/inDictionary.c:18:18: error: too many arguments to function 'strchr'
             if ( strchr(&Memory,"%s",CHar[i])==collect){
                  ^~~~~~
In file included from /in/inDictionary.c:3:0:
/usr/include/string.h:225:14: note: declared here
 extern char *strchr (const char *__s, int __c)
              ^~~~~~
/in/inDictionary.c:20:24: error: assignment to expression with array type
                 collect="";
                        ^
/in/inDictionary.c:26:17: error: expected ';' before 'Memory'
                 Memory[]=collect;
                 ^~~~~~
/in/inDictionary.c:33:1: error: control reaches end of non-void function [-Werror=return-type]
 }
 ^
cc1: all warnings being treated as errors

Information

Submit By
Type
Submission
Problem
mid2 ex1
Homework
Mid2
Language
C
Submit At
2023-07-13 15:38:38
Judged At
2023-08-05 22:15:27
Judged By
Score
0
Total Time
0ms
Peak Memory
0 Bytes