G
Gary Wessle
Hi
I have a
vector<string> which holds numbers, I need to loop and printout those
numbers + a value as doubles .
typedef vector<string>::const_iterator vs_itr;
for(vs_itr i=vect.begin(); i!=vect.end(); ++i){
cout << *i << '\t' << strtod(*i)+val << '\n';
isn't de-referencing the iterator puts out its string value?
I am getting
gen_data.cpp:62: error: cannot convert 'const std::basic_string<char,
std::char_traits<char>, std::allocator<char> >' to 'const char*' for
argument '1' to 'double strtod(const char*, char**)'
thanks
I have a
vector<string> which holds numbers, I need to loop and printout those
numbers + a value as doubles .
typedef vector<string>::const_iterator vs_itr;
for(vs_itr i=vect.begin(); i!=vect.end(); ++i){
cout << *i << '\t' << strtod(*i)+val << '\n';
isn't de-referencing the iterator puts out its string value?
I am getting
gen_data.cpp:62: error: cannot convert 'const std::basic_string<char,
std::char_traits<char>, std::allocator<char> >' to 'const char*' for
argument '1' to 'double strtod(const char*, char**)'
thanks