I think what you're looking for is:
std::string Test = "hello world";
char* NewVar = Test.c_str();
Although I think you'd be better off using an std::stringstream.
daviddoria
Posting Virtuoso
1,996 posts since Feb 2008
Reputation Points: 437
Solved Threads: 204
>>How can I, convert str, from string to char(array of char).
cause, if in array, I can easy split the content of that file.
What is it that you want to do with that String? Have you looked at the methods it provides to see if it already does what you want to do?
Ancient Dragon
Retired & Loving It
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343
Example: Found most of this here
using namespace System;
using namespace System::Collections;
int main()
{
String^ words = "111,222,333";
Char chars[] = {' ', ', ', '->', ':'};
array<String^>^ split = words->Split(',');
for(int i = 0; i < split->Length; i++)
Console::Write( "\t{0}\n", split[ i ] );
}
Ancient Dragon
Retired & Loving It
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343