MCPcopy Create free account
hub / github.com/algorithm-archivists/algorithm-archive / concat

Function concat

contents/huffman_encoding/code/c/huffman.c:41–46  ·  view source on GitHub ↗

The two concat functions are horribly inefficient */

Source from the content-addressed store, hash-verified

39
40/* The two concat functions are horribly inefficient */
41void concat(char** dst, const char* src) {
42 size_t dst_len = strlen(*dst);
43 size_t src_len = strlen(src);
44 *dst = realloc(*dst, src_len + dst_len + 1);
45 strcat(*dst, src);
46}
47
48void concat_char(char** dst, char c) {
49 size_t len = strlen(*dst);

Callers 1

encodeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected