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

# nng\_stat\_string(3)

get statistic string value

## NAME

nng\_stat\_string - get statistic string value

## SYNOPSIS

```
#include <nng/nng.h>
typedef struct nng_stat nng_stat;
const char *nng_stat_string(nng_stat *stat);
```

## DESCRIPTION

The `nng_stat_string()` function returns a string value for the statistic *stat*, which must be of type `NNG_STAT_STRING` (see `nng_stat_type(3)`).

If the statistic is not of type `NNG_STAT_STRING`, then `NULL` will be returned.

**Note**\

The returned string is valid until `nng_stats_free()` is called to free the memory for the snapshot.

## RETURN VALUES

The string value associated with *stat*, or `NULL` if the statistic is not a string type.

## ERRORS

None.

## SEE ALSO

[libnng(3)](/libnng/3.md), [nng\_stats\_get(3)](/nng_stats_get/3.md), nng\_stats\_type(3), nng\_stats\_value(3), [nng\_stat(5)](/nng_stat/5.md), [nng(7)](/nng/7.md)
