c++ - Traversing through a class object list and printing it out -
i have class object structure shown below. here place names objects of class x , bank names objects of class y.
<midwest> <independent bank of midwest/> <midland bank of america/> <texas> <bank of america/> <chase bank/> <wells fargo/> <austin> <supereme national bank/> <master chanse bank/> <austin east> <national bank of austin/> <federal bank/> </austin east> </austin> </texas> <arizona></arizona> <kansas> <federal credit union/> <kansas state bank/> <wichita> <state bank of kansas/> <wichita credit union/> </wichita> </kansas> <missouri> <bank of st louis/> </missouri> <kentucky></kentucky> <iowa></iowa> </midwest>
what want is, traverse parent (midwest) object , go through each child element , print out. trick here is, there can multiple class x objects inside class x object itself.
i couldn't come smart logic loop through , find child elements , print out. above object structure example. in application combination of places , banks , logic should smart enough traverse root parent down each child element.
Comments
Post a Comment