
Efficient string copying and concatenation in C
Among the most heavily used string handling functions declared in the standard C <string.h> header are those that copy and concatenate strings. Both sets of functions copy characters from one object to another, and both return their first argument: a pointer to the beginning of the destination object. The choice of the return value is a source of inefficiency that is the subject of this article.
The code examples shown in this article are for illustration only. They should not be viewed as recommended practice and may contain subtle bugs.
Continue reading “Efficient string copying and concatenation in C”