Download free cpp convert int to string for windows 7 home edition 64bit

C++ convert a string to a number

BOOST_FOREACH(const std::vector<std::string>& row, instruments)

int bid_quantity = atoi( row.at(6) );

double offer_price = atof( row.at(7) );

int offer_quantity = atoi( row.at(8) );

Application.cpp:360: 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**)â

Application.cpp:361: error: cannot convert âconst std::basic_string<char, std::char_traits<char>, std::allocator<char> >â to âconst char*â for argument â1â to âint atoi(const char*)â

Application.cpp:362: error: cannot convert âconst std::basic_string<char, std::char_traits<char>, std::allocator<char> >â to âconst char*â for argument â1â to âdouble atof(const char*)â

Application.cpp:363: error: cannot convert âconst std::basic_string<char, std::char_traits<char>, std::allocator<char> >â to âconst char*â for argument â1â to âint atoi(const char*)â

  • Facebook
  • Twitter
  • LinkedIn
  • https://www.experts-exchange.com/questions/27853165/C-convert-a-string-to-a-number.html copy

To ask questions and find solutions

  • evilrix (3 comments)

std::vector< std::string > rows;

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

double bid_price = atof( char_bid_price ) ;

What is considered best or most efficient way?

You mean, like an array tuples?

Don't use unsafe c functions when working with C++ types. Either use boost lexical cast or, if that's not possible, use a stringstream to perform the conversion.

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

If you are experiencing a similar issue, please ask a related question

Suggested Courses

674 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Enjoyed your answer?

Join our community for more solutions or to ask questions.