Link to home
Start Free TrialLog in
Avatar of Ameerh24
Ameerh24

asked on

how to convert from managed string to char* in c++\clr ?

how to  convert from managed string to char* in c++\clr ?
here is my try below:
but it returns an error:
error C2682: cannot use 'safe_cast' to convert from ' System::String ^ '  to ' char * '

System::String^ s = "test";
	cascade_name = safe_cast<char*,System::String^>(s);
\\ Important note: cascade_name variable is a global variable which has type of char*
\\ from header file: char* cascade_name;

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of jkr
jkr
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Ameerh24
Ameerh24

ASKER

thanks, the solution woks fine