3 ms·
Note that some kind of string builders are necessary for efficient repeated concatenation both in languages with immutable strings and in languages with 0-termi
by tsimionescu 4y ago
Note that some kind of string builders are necessary for efficient repeated concatenation both in languages with immutable strings and in languages with 0-terminated strings.
Using strcat() repeatedly in C for example will mean that the string is being read over and over again to find the end, making an O(n) loop actually O(n²).
- lolinder 4y agoRight, but that's still a performance optimization and not anything like what OP is implying.
- tsimionescu 4y agoYes yes, OP had some really strange ideas. I was just adding some extra info to GP's answer, not trying to contradict them.