I tried with this piece of code but it didn't work
template <class T>
void display(vector<T> vec)
{
vector<T>::iterator MyIter;
for(MyIter=vec.begin();MyIter!=vec.end();MyIter++)
cout<<*MyIter<<" ";
cout<<endl;
}
I mean if there's a way of avoid making a function for each type T (int, char, string). I'm using only builtin types for T.
This is the error message when I compile the program
10 C:\Documents and Settings\ASPIRE\Desktop\perms.cpp expected `;' before "MyIter"