Update examples.
This commit is contained in:
1 parent
f388ed6808
commit
db7af704a6
39 files changed
+278
-169
No files matched your search
@@ -15,7 +15,10 @@ static int intcmp(int a, int b)
|
||||
return a - b;
|
||||
}
|
||||
|
||||
HEAP_GENERATE(h, heap, static, int)
|
||||
CMC_GENERATE_HEAP(h, heap, int)
|
||||
typedef struct heap heap;
|
||||
typedef struct heap_iter heap_iter;
|
||||
|
||||
|
||||
int main(int argc, char const *argv[])
|
||||
{
|
||||
@@ -49,7 +52,7 @@ int main(int argc, char const *argv[])
|
||||
}
|
||||
|
||||
free(buff);
|
||||
h_free(h);
|
||||
h_free(h, NULL);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -19,7 +19,10 @@ int intcmp(int a, int b)
|
||||
}
|
||||
|
||||
// Creates a heap of integers
|
||||
HEAP_GENERATE(h, heap, /* FMOD */, int)
|
||||
CMC_GENERATE_HEAP(h, heap, int);
|
||||
typedef struct heap heap;
|
||||
typedef struct heap_iter heap_iter;
|
||||
|
||||
|
||||
int main(int argc, char const *argv[])
|
||||
{
|
||||
@@ -175,7 +178,7 @@ int main(int argc, char const *argv[])
|
||||
// Dispose the iterator called by h_iter_new()
|
||||
h_iter_free(iter);
|
||||
// Dispose the heap created
|
||||
h_free(my_heap);
|
||||
h_free(my_heap, NULL);
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in new issue
Block a user