You should probably start with function templates and get comfortable with those first.I am trying to wrap my head around class templates.
my_dollar_account is an object of a class you defined. So, when you ask whether it is capable of handling multiple entries like an array, it's all up to you. If you define objects of your class to have a member variable that is an array, then it can handle multiple entries. How does it take care of indexing? Anyway you decide.Is my_dollar_account cappible of handiling multiple enteries like an array. If so, how does it take care of indexing?
I think that is the best approach as well. At this point, it's apparent you've chosen an example that is too difficult for you. Try creating a simpler templated class. For instance, declare a template that has one private member variable that you set in a constructor. Then add a simple get() function that returns the member variable. Your goal is to write a template that will handle any type.Instead, write an array class that holds ints. When you are done and it is working, replace int with T and make the class a template.