I am trying to pass a iterator to a function, this is the iterator and
what it does
typedef vector<string>: :const_iterator vs_itr;
for(vs_itr i=vect.begin(); i!=vect.end(); ++i){
x = fix_it(*i, 2.0);
..
// fix_it(string* 1.235, 2.0) returns double 1.24
double fix_it(vector<s tring>::const_i terator s, double n){
double y = strtod(s->c_str(),0);
return floor( y*pow(10,n) + 0.5 ) / pow(10,n);
}
I am getting an error relating to the type problem
*************** *************** *************** *************** ****
no matching function for call to
'gen_data::fix_ it(const std::basic_stri ng<char, std::char_trait s<char>, std::allocator< char>
>&, double&)'gen_data.h:27: note: candidates are:
double gen_data::fix_i t(__gnu_cxx::__ normal_iterator <const
std::basic_stri ng<char, std::char_trait s<char>, std::allocator< char>
>*, std::vector<std ::basic_string< char, std::char_trait s<char>,std::allocator< char, std::allocator< std::basic_stri ng<char,
std::char_trait s<char>, std::allocator< char >, double)
*************** *************** *************** *************** ****
I tried to fix it by redefining the first argument of the function so
that it is a const vector<string>: :const_iterator but that did not fix
it.