---
name: "ne_buffer_concat"
section: "3"
platform: "linux"
package: "libneon27-dev"
version: "0.34.2-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/ne_buffer_append"
---

# ne\_buffer\_concat(3)

append data to a string buffer

Part of [ne\_buffer\_append(3)](/ne_buffer_append/3.md).

## NAME

ne\_buffer\_append, ne\_buffer\_zappend, ne\_buffer\_concat - append data to a string buffer

## SYNOPSIS

```
#include <ne_string.h>
```

**void ne\_buffer\_append(ne\_buffer \****buf***, const char \****string***, size\_t** *len***);**

**void ne\_buffer\_zappend(ne\_buffer \****buf***, const char \****string***);**

**void ne\_buffer\_concat(ne\_buffer \****buf***, const char \****str***, ...);**

## DESCRIPTION

The **ne\_buffer\_append** and **ne\_buffer\_zappend** functions append a string to the end of a buffer; extending the buffer as necessary. The *len* passed to **ne\_buffer\_append** specifies the length of the string to append; there must be no NUL terminator in the first *len* bytes of the string. **ne\_buffer\_zappend** must be passed a NUL-terminated string.

The **ne\_buffer\_concat** function takes a variable-length argument list following *str*; each argument must be a **char \*** pointer to a NUL-terminated string. A NULL pointer must be given as the last argument to mark the end of the list. The strings (including *str*) are appended to the buffer in the order given. None of the strings passed to **ne\_buffer\_concat** are modified.

## EXAMPLES

The following code will output "Hello, world. And goodbye.".

```
ne_buffer *buf = ne_buffer_create();
ne_buffer_zappend(buf, "Hello");
ne_buffer_concat(buf, ", world. ", "And ", "goodbye.", NULL);
puts(buf->data);
ne_buffer_destroy(buf);
```

## SEE ALSO

ne\_buffer, ne\_buffer\_create, ne\_buffer\_destroy

## COPYRIGHT

Copyright © 2001-2024 Joe Orton\
