Matthias Käppler
2004-11-22 20:45:58 UTC
Hi,
I just browsed libstdc++6-doc and stumbled over a string operation I haven't
noticed before: string::push_back.
If for example I want to append single characters to an std::string, which
one would be better, or is there any difference at all:
mystr.push_back( c );
or
mystr += c;
Any ideas? I used to use the latter one.
Regards,
Matthias
I just browsed libstdc++6-doc and stumbled over a string operation I haven't
noticed before: string::push_back.
If for example I want to append single characters to an std::string, which
one would be better, or is there any difference at all:
mystr.push_back( c );
or
mystr += c;
Any ideas? I used to use the latter one.
Regards,
Matthias