J
Jarek
Hi all!
As I understand string class, whenever string is expanded (i.e. by +=
), the memory is reallocated with new bigger size.
Is it makes sense ( from perforamance point of view ) to pre-allocate
some memory for string, i.e.:
string temp(100,' ');
temp.clear();
temp += "a";
temp += "b";
...
Jarek
As I understand string class, whenever string is expanded (i.e. by +=
), the memory is reallocated with new bigger size.
Is it makes sense ( from perforamance point of view ) to pre-allocate
some memory for string, i.e.:
string temp(100,' ');
temp.clear();
temp += "a";
temp += "b";
...
Jarek