记录详情

Compile Error

foo.c: In function 'merge':
foo.c:4:22: warning: implicit declaration of function 'malloc' [-Wimplicit-function-declaration]
     int *res = (int*)malloc((m+n)*sizeof(int));
                      ^~~~~~
foo.c:4:22: warning: incompatible implicit declaration of built-in function 'malloc'
foo.c:4:22: note: include '<stdlib.h>' or provide a declaration of 'malloc'
foo.c:5:5: warning: implicit declaration of function 'memset' [-Wimplicit-function-declaration]
     memset(res,0,(m+n)*sizeof(int));
     ^~~~~~
foo.c:5:5: warning: incompatible implicit declaration of built-in function 'memset'
foo.c:5:5: note: include '<string.h>' or provide a declaration of 'memset'
foo.c:19:9: warning: statement with no effect [-Wunused-value]
         for(start2;start2<n;start2++){
         ^~~
foo.c:24:9: warning: statement with no effect [-Wunused-value]
         for(start1;start1<m;start1++){
         ^~~
foo.c:31:12: warning: 'return' with a value, in function returning void
     return nums1;
            ^~~~~
foo.c:1:6: note: declared here
 void merge(int* nums1, int nums1Size, int m, int* nums2, int nums2Size, int n){
      ^~~~~
/usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/Scrt1.o: In function `_start':
(.text+0x20): undefined reference to `main'
collect2: error: ld returned 1 exit status
[Hydro](https://hydro.ac)提供评测服务

信息

递交者
类型
递交
题目
A10-2 有序子序列的合并
比赛
2021(四) 作业第二场:见面赛
语言
C
递交时间
2021-10-31 12:12:57
评测时间
2021-10-31 12:12:57
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes