Re: Convert string to char
From: Chris \( Val \) (chrisval_at_bigpond.com.au)
Date: 02/03/04
- Next message: AirPete: "Re: C++ error "System.FormatException""
- Previous message: André Pönitz: "Re: Convert string to char"
- In reply to: KPR: "Convert string to char"
- Next in thread: Sam of California: "Re: Convert string to char"
- Reply: Sam of California: "Re: Convert string to char"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Wed, 4 Feb 2004 00:06:44 +1100
"KPR" <kpruppel@optonline.net> wrote in message news:401F9935.9010705@optonline.net...
| In C++, is there any way to convert a string to a *type char* array, in
| other words,
|
| convert "string mystring;" into "char chrarray[4];"
# include <cstring>
std::strcpy( chrarray, StdString.c_str() );
Be sure to check that you have correctly sized
'chrarray' before proceeding though.
Cheers.
Chris Val
- Next message: AirPete: "Re: C++ error "System.FormatException""
- Previous message: André Pönitz: "Re: Convert string to char"
- In reply to: KPR: "Convert string to char"
- Next in thread: Sam of California: "Re: Convert string to char"
- Reply: Sam of California: "Re: Convert string to char"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]