aboutsummaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorleiyu3 <s444814187@gmail.com>2022-09-22 11:41:31 -0400
committerleiyu3 <s444814187@gmail.com>2022-09-22 11:41:31 -0400
commitc5d89d1ba78a82e6b31aa498fb0f21c4d527e752 (patch)
tree5ac5f694efc95a207dc06e8001003c045982f97c /main.c
parentc1baa76ee589ab8158a9f1fb3173149cebe1dd1b (diff)
downloadvector_c-c5d89d1ba78a82e6b31aa498fb0f21c4d527e752.tar.gz
vector_c-c5d89d1ba78a82e6b31aa498fb0f21c4d527e752.zip
write test up to remove_val
Diffstat (limited to 'main.c')
-rw-r--r--main.c36
1 files changed, 0 insertions, 36 deletions
diff --git a/main.c b/main.c
deleted file mode 100644
index 0c0b282..0000000
--- a/main.c
+++ /dev/null
@@ -1,36 +0,0 @@
1#include <stdio.h>
2#include <stdlib.h>
3#include "vector.h"
4
5int main(void){
6 vector_t vec = vector_init(16);
7
8 printf("The size of the vector is %d.\n", size(vec));
9 printf("The capacity of the vector is %d.\n", capacity(vec));
10 printf("is_empty returns: %d.\n", is_empty(vec));
11
12
13 printf("-----\n");
14
15 for (int i = 0; i < vec.max_size; i++){
16 if (i%2 == 0){
17 push(&vec, 5);
18 continue;
19 }
20 push(&vec, i);
21 }
22 print_vec(vec);
23 remove_val(&vec, 5);
24 /* for (int i = 0; i < vec.max_size; i++){ */
25 /* printf("pop: %d\n", pop(&vec)); */
26 /* delete_vec(&vec, 0); */
27 /* } */
28
29 printf("The size of the vector is %d.\n", size(vec));
30 printf("The first element of the vector is %d.\n", at(vec, 0));
31 printf("is_empty returns: %d.\n", is_empty(vec));
32 print_vec(vec);
33
34 destroy_vec(&vec);
35 return 0;
36}