Главная страница | назад





Article #15947: How do I obtain a char * from an AnsiString?

 Question and Answer Database

FAQ947C.txt   How do I obtain a char * from an AnsiString?
Category   :VCL
Platform    :All
Product    :C++Builder  1.x

Question:

I've got

AnsiString foo;

How do I pass this to a function which needs a char?
(eg., strcpy, etc).

Answer:

foo->c_str().

The c_str() method of the AnsiString class returns
a const char* which can be used to read, but not
modify, the underlying string.

7/2/98 10:32:32 AM
 

Last Modified: 01-SEP-99