I've successfully managed to populate a vector with apointer to a class (well I think I have!)
How do I print out the contents with an iterator (see code below)
All I get printed are the memory locations in hex!
Thanks,
Andy.
vector <borrower*> BorrowerVector;
std::vector<int>::iterator it;
...........
for (int it=0;it !=BorrowerVector.size();it++)
cout << BorrowerVector[it]; <-------------------------------something wrong here I presume?
cout << "size is - " <<BorrowerVector.size()<<" -"; <---------------------------------------------works okay
How do I print out the contents with an iterator (see code below)
All I get printed are the memory locations in hex!
Thanks,
Andy.
vector <borrower*> BorrowerVector;
std::vector<int>::iterator it;
...........
for (int it=0;it !=BorrowerVector.size();it++)
cout << BorrowerVector[it]; <-------------------------------something wrong here I presume?
cout << "size is - " <<BorrowerVector.size()<<" -"; <---------------------------------------------works okay