U++ framework
Do not panic. Ask here before giving up.

Home » U++ Library support » U++ Core » How to convert String to char ?
Re: How to convert String to char ? [message #12511 is a reply to message #12508] Tue, 06 November 2007 21:15 Go to previous messageGo to previous message
mirek is currently offline  mirek
Messages: 14291
Registered: November 2005
Ultimate Member
LiniX wrote on Tue, 06 November 2007 13:08

Thank you .

But library function in put is only char*,

How to change const char* to char* ? or can't ?

Thank you
Watchara Kangkun


You cannot convert String to char *.

The reason is that String interface is created so that efficient reference counted implementation is possible. That excludes this kind of conversion.

If you need to write to String content, you can use StringBuffer though.

String x = "Fun";
StringBuffer sb = x;
char *s = ~sb;
s[1] = 'a';
x = sb;


Note that transfers between StringBuffer and String are very fast, as long as the reference count (if any) is 1.

(Note2: Current String implementation uses reference counting only for long Strings).

Mirek
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: XML , DOM - Modify the tree
Next Topic: Control with window handle
Goto Forum:
  


Current Time: Wed Sep 09 11:03:59 GMT+2 2026

Total time taken to generate the page: 0.01048 seconds