Vector Display Error!

I'm trying to display the Vector's contents but i get this error

no match for 'operator[]' in 'a_set[i]'

any ideas on how this can be resolved?

1
2
3
4
5
6
7
8
9
10
  template <class ItemType>
void DisplaySet(const Set<ItemType> &a_set)
{
     int size = a_set.GetCurrentSize(); //gets size of the set
     cout<<size;
     for (int i=0; i<size; i++)
     {
         cout<<a_set[i]<<" "<<endl;//error
         }
}
Nvm, I was able to solve it and got it to work :D
Topic archived. No new replies allowed.