Home » U++ Library support » LineEdit, EditFields, DocEdit » EditString: how to convert data with "~" operator to char*?
Re: Editstring control [message #1391 is a reply to message #1390] |
Thu, 02 March 2006 00:29 |
|
mirek
Messages: 13975 Registered: November 2005
|
Ultimate Member |
|
|
Cpu86 wrote on Wed, 01 March 2006 17:59 | Ok, but I must declare the pointer as a const?
|
I see...
Yes. Constness is needed to give enough freedom for COW String implementations.
If you want to write those chars, you could use StringBuffer:
String x...
StringBuffer xb(x); //Clears x, takes the content
char *x = xb;
// do what you want, investigate StringBuffer interface to learn more
x = xb; // put it back, clears xb
Of course, another option is to simply copy String to separate buffer, however StringBuffer guarantees minimal copying.. (if possible, it performs none).
Mirek
|
|
|
Goto Forum:
Current Time: Thu Apr 25 23:33:24 CEST 2024
Total time taken to generate the page: 0.03655 seconds
|