Declaration of the Iterator_Exercise() function as used in the Iterator Pattern. More...
Go to the source code of this file.
Macros | |
#define | __ITERATOR_EXERCISE_H__ |
Functions | |
void | Iterator_Exercise (void) |
Example of using the Iterator Pattern. | |
Declaration of the Iterator_Exercise() function as used in the Iterator Pattern.
Definition in file c/Iterator_Exercise.h.
#define __ITERATOR_EXERCISE_H__ |
Definition at line 9 of file c/Iterator_Exercise.h.
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.