Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
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 Go to previous messageGo to previous message
mirek is currently offline  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
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: EditInt callback?
Next Topic: DocEdit bug
Goto Forum:
  


Current Time: Thu Apr 25 23:33:24 CEST 2024

Total time taken to generate the page: 0.03655 seconds