Use this Template to write OO programs with GCC ! Iterator Pattern has been implemented , if you create a class with INode, you can use foreach...eforeach to visit every node!