If, rather, you mean how do you convert an AnsiString to a null-terminated
array of unsigned char, use the c_str() member function. It returns a const
unsigned char* to the underlying character array.
"Maxim Andreev" <fa...@aiocaz.com> wrote in message news:3b06ad6c_2@dnews...
> How to convert AnsiString to unsigned char ?
AnsiString A = "Hello";
char *s = new char[A.Length() + 1];
strcpy(s, A.c_str());
etc...
--
Rudy Velthuis (TeamB)
> In article <3b06ad6c_2@dnews>, Maxim Andreev says...
>
> > How to convert AnsiString to unsigned char ?
>
> AnsiString A = "Hello";
> char *s = new char[A.Length() + 1];
>
> strcpy(s, A.c_str());
I should learn to read. You want an array of unsigned char?
--
Rudy Velthuis (TeamB)
bool foo(char*);
And an AnsiString 'bar', you can pass bar to foo as follows:
foo(bar.c_str();
HTH
Ted
R.E. Byers
ted....@sympatico.ca
char work[100];
String str;
strcpy(work,str.c_str());
"Maxim Andreev" <fa...@aiocaz.com> wrote in message news:3b06ad6c_2@dnews...
AnsiString.c_str();
example:
AnsiString myString = TMemo->Text;
CallThisFunction(myString.c_str());
and that's it.
hope this helps
slavin
"x" <1_i...@msn.com> wrote in message news:3b08d731_1@dnews...