Re: string class to char array conversion


[ Follow Ups ] [ Post Followup ] [ CS1704 Discussion WWWBoard ] [ FAQ ]

Posted by hussein on August 07, 2000 at 17:27:34:

In Reply to: string class to char array conversion posted by ak on August 07, 2000 at 16:34:53:

: how?
: surely there's an easier way that copying character by character via a loop.

string teststring;
char testarray[1024];

strcpy (testarray, teststring.c_str ());

"c_str" is a function that accesses the c-style string version of the string variable.




Follow Ups:



Post a Followup

Name:
E-Mail:

Subject:

Comments:

Optional Link URL:
Link Title:
Optional Image URL:


[ Follow Ups ] [ Post Followup ] [ CS1704 Discussion WWWBoard ] [ FAQ ]