Displaying a certain element among inputted numbers
You can definitely improve it, by replacing the array of pointers with a std::vector&lt;int&gt;.

If you must track usage, I suggest using a map instead, where the keys are 0...9 and the values exist only if the respective index was added.