ABList.hpp:93: error: expected `{' before "cout"
ABList.hpp:93: error: `cout' undeclared (first use this function)"
here is the code that is having problem.
virtual T remove (int pos);//Function protype
template <class T>
T ABList<T>::remove (int pos)
{
try
{
if(pos < 1)
throw 3;
else
{
T temp = a[pos -1];
for(int i = pos-1; i < size; i++)
{
a[i] = a [i+1];
--size;
}
return temp;
}
}
catch(int x)
cout << "ERROR: " << x;
}

New Topic/Question
Reply



MultiQuote





|