Update examples.
This commit is contained in:
1 parent
f388ed6808
commit
db7af704a6
39 files changed
+278
-169
No files matched your search
@@ -12,7 +12,10 @@
|
||||
#include <stdlib.h>
|
||||
#include <time.h>
|
||||
|
||||
QUEUE_GENERATE(q, queue, /* static */, const char *)
|
||||
CMC_GENERATE_QUEUE(q, queue, const char *);
|
||||
typedef struct queue queue;
|
||||
typedef struct queue_iter queue_iter;
|
||||
|
||||
|
||||
int main(int argc, char const *argv[])
|
||||
{
|
||||
@@ -70,7 +73,7 @@ int main(int argc, char const *argv[])
|
||||
printf("\n%lu ice creams remaining to be sold on the next day.\n");
|
||||
}
|
||||
|
||||
q_free(lineup);
|
||||
q_free(lineup, NULL);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -13,7 +13,10 @@
|
||||
#include <inttypes.h>
|
||||
|
||||
// Creates a queue of integers
|
||||
QUEUE_GENERATE(q, queue, /* FMOD */, int)
|
||||
CMC_GENERATE_QUEUE(q, queue, int);
|
||||
typedef struct queue queue;
|
||||
typedef struct queue_iter queue_iter;
|
||||
|
||||
|
||||
int main(int argc, char const *argv[])
|
||||
{
|
||||
@@ -189,7 +192,7 @@ int main(int argc, char const *argv[])
|
||||
// Dispose the iterator called by q_iter_new()
|
||||
q_iter_free(iter);
|
||||
// Dispose the queue created
|
||||
q_free(my_queue);
|
||||
q_free(my_queue, NULL);
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in new issue
Block a user