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 » U++ Core » How do I get a char * of the string stored in the String class?
Re: How do I get a char * of the string stored in the String class? [message #102 is a reply to message #97] Thu, 24 November 2005 12:01 Go to previous messageGo to previous message
gprentice is currently offline  gprentice
Messages: 260
Registered: November 2005
Location: New Zealand
Experienced Member


From looking at String source code, it stores a null at the end of a string and has an operator funciton returning const char * so you can actually just use your string object anywhere a const char * is needed - or you could explicitly cast it.

(Maybe Mirek can confirm the null termination is always there ...)


void gp1(const char * p)
{
PromptOK(p);
}


void HelloWorld::About()
{
PromptOK("{{1@5 [@9= This is the]::@2 [A5@0 Ultimate`+`+ Hello world sample}}");

String abc = "hello";
gp1(abc);
}

Graeme
 
Read Message
Read Message
Read Message
Read Message
Read Message
Next Topic: Dynamic Linking
Goto Forum:
  


Current Time: Wed Sep 03 20:08:00 CEST 2025

Total time taken to generate the page: 0.05004 seconds