diff options
| author | Tyge Løvset <[email protected]> | 2020-09-20 07:54:04 +0200 |
|---|---|---|
| committer | Tyge Løvset <[email protected]> | 2020-09-20 07:54:04 +0200 |
| commit | a9881058fbe47a90d4614f9fb5d693633dbdc7af (patch) | |
| tree | b49db605aed741b43a1cd6ef7c369fcee59e24ad /examples/priority.c | |
| parent | 240c4d27067fb6dd04b3964dcfd46342ee1a2de3 (diff) | |
| download | STC-modified-a9881058fbe47a90d4614f9fb5d693633dbdc7af.tar.gz STC-modified-a9881058fbe47a90d4614f9fb5d693633dbdc7af.zip | |
Added c_foreach (i,N) and c_foreach (N), and updated README.md
Diffstat (limited to 'examples/priority.c')
| -rw-r--r-- | examples/priority.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/examples/priority.c b/examples/priority.c index bce14f49..e4a20da9 100644 --- a/examples/priority.c +++ b/examples/priority.c @@ -16,18 +16,18 @@ int main() { cpqueue_i heap = cpqueue_i_init();
// Push ten million random numbers to priority queue
- c_forrange (i, int, N)
+ c_forrange (N)
cpqueue_i_push(&heap, crand_uniform_i64(&pcg, &dist));
// push some negative numbers too.
c_push_items(&heap, cpqueue_i, {-231, -32, -873, -4, -343});
- c_forrange (i, int, N)
+ c_forrange (N)
cpqueue_i_push(&heap, crand_uniform_i64(&pcg, &dist));
// Extract the hundred smallest.
- c_forrange (i, int, 100) {
+ c_forrange (100) {
printf("%zd ", *cpqueue_i_top(&heap));
cpqueue_i_pop(&heap);
}
|
