Record Detail

Compile Error

/in/vector.c: In function 'push_back':
/in/vector.c:9:14: error: implicit declaration of function 'malloc' [-Werror=implicit-function-declaration]
   int* tmp = malloc(A -> limit * 2 * sizeof(int));
              ^~~~~~
/in/vector.c:9:14: error: incompatible implicit declaration of built-in function 'malloc' [-Werror]
/in/vector.c:9:14: note: include '<stdlib.h>' or provide a declaration of 'malloc'
/in/vector.c:11:3: error: implicit declaration of function 'free' [-Werror=implicit-function-declaration]
   free(A -> mem);
   ^~~~
/in/vector.c:11:3: error: incompatible implicit declaration of built-in function 'free' [-Werror]
/in/vector.c:11:3: note: include '<stdlib.h>' or provide a declaration of 'free'
/in/vector.c: In function 'pop_back':
/in/vector.c:21:14: error: incompatible implicit declaration of built-in function 'malloc' [-Werror]
   int* tmp = malloc(A -> limit / 2 * sizeof(int));
              ^~~~~~
/in/vector.c:21:14: note: include '<stdlib.h>' or provide a declaration of 'malloc'
/in/vector.c:23:3: error: incompatible implicit declaration of built-in function 'free' [-Werror]
   free(A -> mem);
   ^~~~
/in/vector.c:23:3: note: include '<stdlib.h>' or provide a declaration of 'free'
/in/vector.c: In function 'newVector':
/in/vector.c:41:21: error: incompatible implicit declaration of built-in function 'malloc' [-Werror]
  struct vector *A = malloc(sizeof(struct vector));
                     ^~~~~~
/in/vector.c:41:21: note: include '<stdlib.h>' or provide a declaration of 'malloc'
cc1: all warnings being treated as errors

Information

Submit By
Type
Submission
Homework
Lab7 Quiz
Language
C
Submit At
2020-06-30 15:51:05
Judged At
2020-06-30 15:51:05
Judged By
Score
0
Total Time
0ms
Peak Memory
0 Bytes