---
name: "tickit_string_new"
section: "3"
platform: "linux"
package: "libtickit-dev"
version: "0.4.3-2"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/tickit_string_new"
---

# tickit\_string\_new(3)

create a counted string

## NAME

tickit\_string\_new - create a counted string

## SYNOPSIS

```
#include <tickit.h>

TickitString *tickit_string_new(const char *str, size_t len);
```

Link with *-ltickit*.

## DESCRIPTION

**tickit\_string\_new**() creates a new **TickitString** instance. It will be initialised with the contents of the given string buffer.

The reference count of a newly-constructed string instance will be one. This can be incremented or decremented using [**tickit\_string\_ref**(3)](/tickit_string_ref/3.md) and [**tickit\_string\_unref**(3)](/tickit_string_unref/3.md). When its reference count reaches zero it is destroyed.

## RETURN VALUE

If successful, **tickit\_string\_new**() returns a pointer to the new instance.

## SEE ALSO

[**tickit\_string\_get**(3)](/tickit_string_get/3.md), [**tickit\_string**(7)](/tickit_string/7.md), [**tickit**(7)](/tickit/7.md)
