C++: boost::lexical_cast Minimalbeispiel

English Deutsch
boost_lexical_cast_example.cpp
#include <boost/lexical_cast.hpp>
#include <iostream>

int main() {
    int a = boost::lexical_cast<int>("123");
    int b = boost::lexical_cast<int>("456");

    int c = a + b;
    std::cout << c << std::endl; //Gibt 579 aus
}

Check out similar posts by category: Boost, C/C++