Record Detail

Compile Error

/in/merge.c: In function 'merge':
/in/merge.c:15:25: error: passing argument 1 of 'strncpy' from incompatible pointer type [-Werror=incompatible-pointer-types]
                 strncpy(arrSorted,subArr1[i],1);
                         ^~~~~~~~~
In file included from /in/merge.c:5:0:
/usr/include/string.h:124:14: note: expected 'char * restrict' but argument is of type 'int *'
 extern char *strncpy (char *__restrict __dest,
              ^~~~~~~
/in/merge.c:15:35: error: passing argument 2 of 'strncpy' makes pointer from integer without a cast [-Werror=int-conversion]
                 strncpy(arrSorted,subArr1[i],1);
                                   ^~~~~~~
In file included from /in/merge.c:5:0:
/usr/include/string.h:124:14: note: expected 'const char * restrict' but argument is of type 'char'
 extern char *strncpy (char *__restrict __dest,
              ^~~~~~~
/in/merge.c:16:44: error: expected ']' before ':' token
                 strncpy(arrSorted,subArr2[i:i+j],j)
                                            ^
/in/merge.c:16:25: error: passing argument 1 of 'strncpy' from incompatible pointer type [-Werror=incompatible-pointer-types]
                 strncpy(arrSorted,subArr2[i:i+j],j)
                         ^~~~~~~~~
In file included from /in/merge.c:5:0:
/usr/include/string.h:124:14: note: expected 'char * restrict' but argument is of type 'int *'
 extern char *strncpy (char *__restrict __dest,
              ^~~~~~~
/in/merge.c:16:35: error: passing argument 2 of 'strncpy' makes pointer from integer without a cast [-Werror=int-conversion]
                 strncpy(arrSorted,subArr2[i:i+j],j)
                                   ^~~~~~~
In file included from /in/merge.c:5:0:
/usr/include/string.h:124:14: note: expected 'const char * restrict' but argument is of type 'char'
 extern char *strncpy (char *__restrict __dest,
              ^~~~~~~
/in/merge.c:17:13: error: expected ';' before '}' token
             }
             ^
cc1: all warnings being treated as errors

Information

Submit By
Type
Submission
Homework
Homework 5
Language
C
Submit At
2022-07-02 23:27:04
Judged At
2022-07-05 08:56:05
Judged By
Score
0
Total Time
0ms
Peak Memory
0 Bytes