str_concat()

str_concat()#

str_concat() concatenates two strings into a newly allocated buffer and returns the result.

Prototype

char *str_concat(
    const char *str1,
    const char *str2
);

Parameters

Key

Type

Description

str1

const char *

The first string to concatenate.

str2

const char *

The second string to concatenate.


Return Value

A newly allocated string containing the concatenation of str1 and str2. The caller must free the returned string using str_concat_free().

Notes

If either str1 or str2 is NULL, it is treated as an empty string.

Prototype

// Not applicable in JS

Prototype

# Not applicable in Python
Examples
// TODO C examples
// TODO JS examples
# TODO Python examples