Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

C++

Name: Anon 2009-01-28 2:07

Hey, I am a complete noob to c++, and I need to know how to add strings.

Eg, I have:
a="one"
b="two"
c="three"

and I would like "d" to equal "onetwothree".

Thank you for any help

Name: Anonymous 2009-01-28 17:51

>>16
Note that strcat in >>14 walking the length of the string is no different from strlen walking the length of the string in >>11, except that it's more clear to the compiler what you're doing (thus enabling additional optimizations, as shown by the performance increase noted in >>14).

The reason assembly was asked for is because gcc, at least, provides internal implementations for most of the string functions (if -fno-builtins isn't specified, all functions used in this thread are builtins) and does some naughty stuff to decrease runtimes[1].
                         
References:
[1] http://gcc.gnu.org/onlinedocs/gcc-4.3.2/gcc/Other-Builtins.html

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List