The compiler says the following error message for my reverse vector function at the line "extra = lines[i]. I want to copy one vector to another with the assignment operator.
|no match for 'operator=' (operand types are 'std::vectorstd::__cxx11::basic_string<char >' and '__gnu_cxx::__alloc_traitsstd::allocator<std::__cxx11::basic_string<char >, std::__cxx11::basic_string >::value_type' {aka 'std::__cxx11::basic_string'})
Code:
void reverse_vector(vector<string>& lines){
vector<string> extra;
int i;
for(i = 0; i < lines.size(); i++){
extra = lines[i];
lines[i] = lines[lines.size() - 1 - i];
lines[lines.size() - 1 - i] = extra;
cout << lines[i] << " ";
cout << endl;
}
}