WvStreams
intlistex.cc
00001 #include "wvstringlist.h"
00002 #include "wvhashtable.h"
00003 #include <stdio.h>
00004 
00005 DeclareWvList(int);
00006 //Declaration of list of integers
00007 
00008 int main()
00009 {
00010 
00011   int a=5, b=6;
00012 
00013   intList l; //the list
00014 
00015 
00016   intList::Iter i(l); //the iterator
00017 
00018   l.add(&a, false);
00019   l.add(&b, false);
00020 
00021   for (i.rewind(); (i.next()) ; )
00022     printf("Foo: %d\n", i());
00023 
00024   //prints:
00025   //Foo: 5
00026   //Foo: 6
00027 
00028 
00029   return 0;
00030 }