The first issue I see with your question is that it's not one question but two different questions packed into one. Don't do that. Focus on one problem at a time. One question per question.
The first part of your question doesn't actually contain a problem. You've got an idea of a solution, and don't appear to have tried it out. So you don't know if you have a problem yet (your idea might very well work). And then you ask for "better" ways to accomplish a thing when it's not clear what your requirements or your implementation is. That's impossible to answer correctly. There's always several ways to do stuff, and the "best" one will depend on a whole lot of factors, including how familiar you are with the (potentially numerous) alternatives.
Your second question has the same sort of problem for the "most preferred" way of doing things. It also, in my opinion, fails the "do your research" part - there are lots of examples of stack (and list, and queue, and ...) containers out there. What the basic building blocks of such a structure needs to contain can be easily found out with a search. Maybe your case requires something above the basic structure, but you've not given any specifics, so there's not much that can be said except providing a sample implementation - but Google and Bing can already do that quite efficiently (most likely pointing you back to Stack Overflow for at least some of the first hits).
I believe that second problem is why that close reason was selected. The impression I get from reading your question is that you haven't actually tried things out yet, or looked at existing implementations. (I know very well this might not be the case, but all I can go by is what's written in your post.)
You'll get much better results from Stack Overflow if you show an actual problem. This usually requires that you've coded up something (even if it's pseudo-code).