$include_dir="/home/hyper-archives/boost-users/include"; include("$include_dir/msg-header.inc") ?>
Subject: Re: [Boost-users] Concatenating int value to string ..??
From: Marcel Raad (raad_at_[hidden])
Date: 2013-11-04 06:27:07
Rahul Mathur <srivmuk <at> gmail.com> writes:
> TagName = TID + boost::lexical_cast<std::string>(TagID); // Should be as -
> Apple01
> TagInitial = TagName + boost::lexical_cast<std::string>(Value); // Should
> be as -> Apple01000
> int i = boost::lexical_cast<int>(TagInitial) + 1; // Should be as ->
> Apple01001
> TagUId = boost::lexical_cast<std::string>(i);
You cannot cast "Apple01000" to int. Try this:
// Should be as -> Apple01001
TagUId = TagName + boost::lexical_cast<std::string>(++Value);