Record Detail

Compile Error

/in/ex1.c: In function 'main':
/in/ex1.c:9:12: error: initialization makes integer from pointer without a cast [-Werror=int-conversion]
     char a="0";
            ^~~
/in/ex1.c:15:12: error: passing argument 1 of 'strcpy' makes pointer from integer without a cast [-Werror=int-conversion]
     strcpy(a,string);
            ^
In file included from /usr/include/features.h:424:0,
                 from /usr/include/x86_64-linux-gnu/bits/libc-header-start.h:33,
                 from /usr/include/stdio.h:27,
                 from /in/ex1.c:1:
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:88:1: note: expected 'char * restrict' but argument is of type 'char'
 __NTH (strcpy (char *__restrict __dest, const char *__restrict __src))
 ^
/in/ex1.c:16:19: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
     for (int i=6;i<strlen(string);++i){
                   ^
/in/ex1.c:17:15: error: subscripted value is neither array nor pointer nor vector
         if (*a[i]=='-'){
               ^
/in/ex1.c:23:26: error: passing argument 1 of 'transfer' makes integer from pointer without a cast [-Werror=int-conversion]
         arr2[i]=transfer(string);
                          ^~~~~~
/in/ex1.c:5:6: note: expected 'char' but argument is of type 'char *'
 char transfer(char);
      ^~~~~~~~
/in/ex1.c:28:19: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
     for (int i=k;i<strlen(string);++i){
                   ^
/in/ex1.c:31:27: error: passing argument 2 of 'strcat' from incompatible pointer type [-Werror=incompatible-pointer-types]
     char arr4=strcat(arr1,arr2);
                           ^~~~
In file included from /usr/include/features.h:424:0,
                 from /usr/include/x86_64-linux-gnu/bits/libc-header-start.h:33,
                 from /usr/include/stdio.h:27,
                 from /in/ex1.c:1:
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:126:1: note: expected 'const char * restrict' but argument is of type 'int *'
 __NTH (strcat (char *__restrict __dest, const char *__restrict __src))
 ^
/in/ex1.c:31:15: error: initialization makes integer from pointer without a cast [-Werror=int-conversion]
     char arr4=strcat(arr1,arr2);
               ^~~~~~
/in/ex1.c:32:21: error: passing argument 1 of 'strcat' makes pointer from integer without a cast [-Werror=int-conversion]
     char new=strcat(arr4,arr3);
                     ^~~~
In file included from /usr/include/features.h:424:0,
                 from /usr/include/x86_64-linux-gnu/bits/libc-header-start.h:33,
                 from /usr/include/stdio.h:27,
                 from /in/ex1.c:1:
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:126:1: note: expected 'char * restrict' but argument is of type 'char'
 __NTH (strcat (char *__restrict __dest, const char *__restrict __src))
 ^
/in/ex1.c:32:14: error: initialization makes integer from pointer without a cast [-Werror=int-conversion]
     char new=strcat(arr4,arr3);
              ^~~~~~
/in/ex1.c:32:10: error: unused variable 'new' [-Werror=unused-variable]
     char new=strcat(arr4,arr3);
          ^~~
/in/ex1.c: In function 'transfer':
/in/ex1.c:60:1: error: control reaches end of non-void function [-Werror=return-type]
 }
 ^
cc1: all warnings being treated as errors

Information

Submit By
Type
Submission
Homework
Homework 6
Language
C
Submit At
2022-07-10 23:51:59
Judged At
2022-07-13 14:35:13
Judged By
Score
0
Total Time
0ms
Peak Memory
0 Bytes