On Tue, Sep 23, 2008 at 5:26 AM, Charles Carroll <[EMAIL PROTECTED]> wrote:
> If one has to put a string into a character array (and this program
> does not seem to have a good reason to do so) then .c_str will work.
>
> char blah[8];
> string blah2="Hello";
>
> blah=blah2,c_str();

That will not do what you seem to think it does. You perhaps meant:

strcpy(blah, blah2.c_str());

Or perhaps

char* blah;
string blah2="Hello";
blah=blah2.c_str();

-- 
PJH

http://shabbleland.myminicity.com/ind

Reply via email to