Implementation of the Iterator_Exercise() function as used in the Iterator Pattern. More...
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "Iterator_Iterators.h"
#include "Iterator_Exercise.h"
Go to the source code of this file.
Functions | |
void | Iterator_Exercise (void) |
Example of using the Iterator Pattern. | |
Implementation of the Iterator_Exercise() function as used in the Iterator Pattern.
Definition in file Iterator_Exercise.c.
void Iterator_Exercise | ( | void | ) |
Example of using the Iterator Pattern.
A custom container is instantiated (it already contains hard-coded data to iterate over). The custom container can then deliver three iterators, each providing a different aspect of the hard-coded data.
The output shows the output from each iterator.
Definition at line 32 of file Iterator_Exercise.c.
References ItemIterator::item, Iterator_GetItems(), Iterator_GetKeys(), Iterator_GetValues(), Iterator_NextItem(), Iterator_NextKey(), Iterator_NextValue(), ItemPair::key, KeyIterator::key, ItemPair::value, and ValueIterator::value.