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 » Developing U++ » U++ Developers corner » About string, String and const char *
About string, String and const char * [message #7413] Thu, 28 December 2006 10:16 Go to previous message
mirek is currently offline  mirek
Messages: 13984
Registered: November 2005
Ultimate Member
Well, I have just down an interesting investigation (because of some discussion thread in comp.alt.c++.moderated) which also nicely explains why in U++ we are using "const char*" instead of String so often.

#include <string>

void foo(const std::string& x);
void foo2(const char *s);

void Test1()
{
	foo("just a test");
}

void Test2()
{
	foo2("just a test");
}


Now Test1 has 115 bytes, Test2 12 bytes... (and it is similar for String too).

Mirek
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Build UPP modules into DLL with import library
Next Topic: Twain - support for scanners - needed
Goto Forum:
  


Current Time: Mon Jun 10 20:50:56 CEST 2024

Total time taken to generate the page: 0.02251 seconds