- you need to first initialise begin1 and second to nullptr as currently the first time begin1 is passed to InStack it's value is undefined.

- iterate the stack begin1 and for every third entry (keep a counter of the number of entries in the iteration and if % 3 (mod 3) is 0 then you have a third entry) then just call InStack(second, n) where n is the value from the iteration of begin1. This will create the stack second. Then just use View(second) to display the second stack etc.