Boost logo

Boost Users :

Subject: Re: [Boost-users] convert from string to int
From: Igor R (boost.lists_at_[hidden])
Date: 2010-02-11 11:24:30


> hi, what is the sintax of the command to do a conversion from string to int?
> thanks

#include <boost/lexical_cast.hpp>

std::string s = "123";
int number = boost::lexical_cast<int>(s);


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net