(Context: I just replied to the same message in alt.comp.lang.learn.c-c++)

Just FYI, multi-posting (i.e. posting the same message to separate
newsgroups one at a time) isn't such a great plan -- if you want to post
to several newsgroups (only where the message is appropriate in all the
groups and it's really sensible), then cross-posting (posting the same
thing to separate newsgroups in a single message) is the way to go.

On Sep 15, 3:09 pm, errfet <> wrote:
> Hello everybody
>
> I needed any method of conversion std::string to char*. I found some
> useful library functions, and in order to make conversion i had to
> write some code for example:
>

First of all, note that <cstring> in <string.h> in the std::namespace.
std::string is defined in <string>

You can use a vector instead of using new[].
vector is guaranteed to be contiguous as of C++03

There is a lot of whitespace in the message. Unfortunately Outlook Express
does not display this correctly and removes it when you reply. What's new
for me was that even your Thunderbird has this problem...
> User-Agent: Mozilla/5.0 (X11; U; SunOS i86pc; en-US; rv:1.9.1.7)
> Gecko/20100214 Lightning/1.0b1 Thunderbird/3.0.1

"Helge Kruse" <> wrote in message
news:4c921f9b$0$7657$-online.net...
> There is a lot of whitespace in the message. Unfortunately Outlook Express
> does not display this correctly and removes it when you reply.

Not in general. That seems to be a problem when tabs are used for
formatting. That's usually a bad idea anyway, particularly on usenet.

Oh, I've said it tens of times, the solution for both is a good long whipping
with course salt applied to the wounds, then tar and feathers for the
irresponsible people, and a public display of them where we can spit on them.

* Ian Collins, on 16.09.2010 21:59:
> On 09/17/10 07:57 AM, Ian Collins wrote:
>> On 09/17/10 01:46 AM, Helge Kruse wrote:
>>> "Ian Collins"<> wrote in message
>>> news:...
>>>> On 09/16/10 10:09 AM, errfet wrote:
>>>>>
>>>>> int str_to_char (char * dst, const string&str){
>>>>> dst = new char [str.size()+1];
>>>>> strcpy(dst, str.c_str());
>>>>> return (str.size()+1);
>>>>> }
>>>>
>>>> White space is free these days...
>>>
>>> There is a lot of whitespace in the message. Unfortunately Outlook
>>> Express
>>> does not display this correctly and removes it when you reply. What's new
>>> for me was that even your Thunderbird has this problem...
>>
>> That was a recent "enhancement"! The solution (for both?) is to avoid tabs.
>
> I posted too soon, spaces in the original are preserved by Thunderbird, it was
> this single function that didn't have any in the OP.

TB 3.x removes spaces when replying to a "format: flowed" message.

It's moronic.

But then so is much software today; I think it reflects that people aren't in
general promoted for their technical skills, so that in many cases people who
can imagine that such functionality is good, are those who set the rules.

Alf P. Steinbach /Usenet <>, on
16/09/2010 22:10:46, wrote:
> * Ian Collins, on 16.09.2010 21:59:
>> On 09/17/10 07:57 AM, Ian Collins wrote:
>>> On 09/17/10 01:46 AM, Helge Kruse wrote:
>>>> "Ian Collins"<> wrote in message
>>>> news:...
>>>>> On 09/16/10 10:09 AM, errfet wrote:
>>>>>>
>>>>>> int str_to_char (char * dst, const string&str){
>>>>>> dst = new char [str.size()+1];
>>>>>> strcpy(dst, str.c_str());
>>>>>> return (str.size()+1);
>>>>>> }
>>>>>
>>>>> White space is free these days...
>>>>
>>>> There is a lot of whitespace in the message. Unfortunately Outlook
>>>> Express
>>>> does not display this correctly and removes it when you reply.
>>>> What's new
>>>> for me was that even your Thunderbird has this problem...
>>>
>>> That was a recent "enhancement"! The solution (for both?) is to avoid
>>> tabs.
>>
>> I posted too soon, spaces in the original are preserved by
>> Thunderbird, it was
>> this single function that didn't have any in the OP.
>
> TB 3.x removes spaces when replying to a "format: flowed" message.
>
> It's moronic.
>
> But then so is much software today; I think it reflects that people
> aren't in general promoted for their technical skills, so that in many
> cases people who can imagine that such functionality is good, are those
> who set the rules.

Well, at least for this very case, it appears to be a known bug... some
weeks ago I've struggled a bit to find a mention of it in the TB
BugZilla and right now I have no handy reference... in any case, you
know, crap happens, that's not necessarily sign of incompetence or
deliberate sabotage ;-)

Share This Page

Welcome to The Coding Forums!

Welcome to the Coding Forums, the place to chat about anything related to programming and coding languages.

Please join our friendly community by clicking the button below - it only takes a few seconds and is totally free. You'll be able to ask questions about coding or chat with the community and help others.
Sign up now!