Brett McCoy wrote:
> On Fri, Oct 23, 2009 at 7:15 AM, totallyfreeenergy
> <[email protected]> wrote:
> 
>> While i could not get string catenations to work still (another matter 
>> altogether),
> 
> What are you having trouble with for the string concatenation? Use
> strcat() for C-style strings and use +-operator for C++ std::string.
> 
>> I am now trying to right trim since I have to convert it to a integer and I 
>> am getting unwanted zeros in place of white
>> space. I am still using VC++ 2008 express.
> 
> There are no ltrim or rtrim functions in C or C++, you will have to
> roll your own or find a 3rd party library like Boost to get the
> algorithm. A quick Google search should yield examples on how to write
> your own ltrim or rtrim function.
> 
> How are you converting the string to integer?
> 
> -- Brett
> ------------------------------------------------------------
> "In the rhythm of music a secret is hidden;
>     If I were to divulge it, it would overturn the world."
>                -- Jelaleddin Rumi

The BString class implementation from Safe C++ Design Principles has 
RTrim(), LTrim() and LRTrim() member functions built into it.  It also 
has far superior concatenation capabilities than std::string.  Should 
build fine in VC++ 2008 Express.

http://f1.grp.yahoofs.com/v1/IJrrShhVr7cBjDOvAME5FQQr6w0GNBE_DCMH5WQQ6uvjoWu3OKc4u361TxivE1pefyRE6K755c5FWB7uJSk1/Books/SafeCPPDesignPrinciplesSource.zip

Above link contains BString (Base.cpp, Base.h).

-- 
Thomas Hruska
CubicleSoft President
Ph: 517-803-4197

*NEW* MyTaskFocus 1.1
Get on task.  Stay on task.

http://www.CubicleSoft.com/MyTaskFocus/

Reply via email to