So this is my code..
Code:
vector<string> frame(const vector<string>& v){
vector<string> ret;
string::size_type maxlen = width(v);
string border(maxlen + 4, '*');
//write the top border
ret.push_back(border);
for(vector<string>::const_iterator i = v.begin(); i != v.end(); ++i){
ret.push_back("* " + *v + string(maxlen - ((*v).size()), ' ') + " *");
}
ret.push_back(border);
return ret;
}
If I slightly modified this code so it would work with vector accessors, vector[i], it would work. However following my book I was asked to change it to use iterators. I did so, but now it is giving me an illegal indirection error. Ive tried debugging it with the little debugging skills I have but it didn't really help. What is this illegal indirection error?