diff options
| author | realtradam <[email protected]> | 2023-04-12 15:55:33 -0400 |
|---|---|---|
| committer | realtradam <[email protected]> | 2023-04-12 15:55:33 -0400 |
| commit | 0841165881871ee01b782129be681209aeed2423 (patch) | |
| tree | 8a76b61dcaab381b6b42305201ae8b6259f6b6c0 /misc/examples/lower_bound.c | |
| parent | 554f3e8acf7855b5d6a90cc68cefb7445460b03c (diff) | |
| parent | 0516aa3ae823ed9a22b2c5f776948c8447c32c31 (diff) | |
| download | STC-modified-0841165881871ee01b782129be681209aeed2423.tar.gz STC-modified-0841165881871ee01b782129be681209aeed2423.zip | |
Merge branch 'master' into modified
Diffstat (limited to 'misc/examples/lower_bound.c')
| -rw-r--r-- | misc/examples/lower_bound.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/misc/examples/lower_bound.c b/misc/examples/lower_bound.c index f492ccaa..6ec7544c 100644 --- a/misc/examples/lower_bound.c +++ b/misc/examples/lower_bound.c @@ -9,10 +9,9 @@ int main() { // TEST SORTED VECTOR - c_auto (cvec_int, vec) { int key, *res; - vec = c_make(cvec_int, {40, 600, 1, 7000, 2, 500, 30}); + cvec_int vec = c_make(cvec_int, {40, 600, 1, 7000, 2, 500, 30}); cvec_int_sort(&vec); @@ -35,13 +34,13 @@ int main() printf(" %d\n", *i.ref); puts(""); + cvec_int_drop(&vec); } - + // TEST SORTED SET - c_auto (csset_int, set) { int key, *res; - set = c_make(csset_int, {40, 600, 1, 7000, 2, 500, 30}); + csset_int set = c_make(csset_int, {40, 600, 1, 7000, 2, 500, 30}); key = 100; res = csset_int_lower_bound(&set, key).ref; @@ -60,5 +59,7 @@ int main() c_foreach (i, csset_int, it1, it2) printf(" %d\n", *i.ref); + + csset_int_drop(&set); } } |
