REFACTOR: Error debugging for most functions
This commit is contained in:
+23
-13
@@ -22,21 +22,31 @@
|
||||
int
|
||||
main()
|
||||
{
|
||||
char arr[] = { 'a' };
|
||||
// Vec8_t v1 = create(arr, find_len(arr));
|
||||
// Vec8_t v1 = create((char[]) { 'a', 'b', 'c', 'd' }, 4);
|
||||
Vec8_t v1 = create(nullptr, 0);
|
||||
char arr[] = { '1', '2', '3', '4' };
|
||||
Vec8_t v1 = create(arr, find_len(arr));
|
||||
Vec8_t v2 = create((char[]) { 'a', 'b', 'c', 'd' }, 4);
|
||||
|
||||
print_vec(&v1);
|
||||
print_vec(&v2);
|
||||
|
||||
if (swap(&v1, &v2))
|
||||
{
|
||||
print_vec(&v1);
|
||||
print_vec(&v2);
|
||||
}
|
||||
// Vec8_t v1 = create(nullptr, 0);
|
||||
// v1 = reserve(&v1, 10);
|
||||
// v1 = pop_back(&v1);
|
||||
for (int i = 0; i < 10; i++)
|
||||
{
|
||||
v1 = push_back(&v1, 'a');
|
||||
}
|
||||
print_vec(&v1);
|
||||
printf("SIZE: %zu\n", v1.size);
|
||||
v1 = push_back(&v1, 'a');
|
||||
print_vec(&v1);
|
||||
printf("SIZE: %zu\n", v1.size);
|
||||
// for (int i = 0; i < 10; i++)
|
||||
// {
|
||||
// v1 = push_back(&v1, 'a');
|
||||
// }
|
||||
// print_vec(&v1);
|
||||
// printf("SIZE: %zu\n", v1.size);
|
||||
// v1 = push_back(&v1, 'a');
|
||||
// print_vec(&v1);
|
||||
// printf("SIZE: %zu\n", v1.size);
|
||||
delete(&v1);
|
||||
delete(&v2);
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user