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

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: 14291
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: Tue May 19 11:23:30 GMT+2 2026

Total time taken to generate the page: 0.00508 seconds