The stringstream worked perfectly. thank you very much
2013/10/31 Schmoll Walter <walter.schm...@andritz.com>
> …****
>
> returned += static_cast<int> (*bp++);****
>
> …
> returned += static_cast<int> (*bp++);****
>
> …
>
> ****
>
> I never used std::string, so I’m no expert. But according to
> http://www.cplusplus.com/reference/string/string/operator+=/ there is no
> operater which takes an int on the right side.****
>
> I’m not sure why the compiler is accepting this, probably you should turn
> on and pay attention to warnings. What’s happening in my opinion: char is
> more or less nothing else than an 8 bit-integer. So the closest matching
> member function would be****
>
> string& operator+= (char c)****
>
> So the integer is stripped to its least significant 8 bits and added as
> char.****
>
> ** **
>
> Try the following:****
>
> returned += std::to_string(static_cast<int>(*bp++));****
>
> ** **
>
> Alternatively you could use an instance of std:stringstream (called for
> example ss), use code very similar to your other function (using ss instead
> of cout with << and things) and returning std:stringstream.str() (i.e.
> return ss.str()).****
>
> ** **
>
> If you still have no luck, you could try to ask some C++ bulletin board as
> your problem seems to be C++ specific.****
>
> ** **
>
> Good Luck****
>
> Walter****
>
> ** **
>
> ** **
> ------------------------------
>
> *This message and any attachments are solely for the use of the intended
> recipients. They may contain privileged and/or confidential information or
> other information protected from disclosure. If you are not an intended
> recipient, you are hereby notified that you received this email in error
> and that any review, dissemination, distribution or copying of this email
> and any attachment is strictly prohibited. If you have received this email
> in error, please contact the sender and delete the message and any
> attachment from your system.*
>
> *Thank You.*
> ------------------------------
>
------------------------------------------------------------------------------
Android is increasing in popularity, but the open development platform that
developers love is also attractive to malware creators. Download this white
paper to learn more about secure code signing practices that can help keep
Android apps secure.
http://pubads.g.doubleclick.net/gampad/clk?id=65839951&iu=/4140/ostg.clktrk
_______________________________________________
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders