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

# mtree\_parent(3)

return node number of parent node

## NAME

mtree\_parent - return node number of parent node

## LIBRARY

Librecast library (*liblibrecast*, *-llibrecast*)

## SYNOPSIS

```
#include <librecast/mtree.h>
```

**size\_t mtree\_parent(size\_t** *node***);**

Compile and link with *-llibrecast*.

## DESCRIPTION

The **mtree\_nnode** function returns the node number of the parent of *node.*

This calculation is independent of the tree, and is implemented as a macro.

Nodes are numbered from 0 = root.

## RETURN VALUE

**mtree\_parent**() returns the number of the parent node.

## ERRORS

None.

## SEE ALSO

[**mtree\_init**(3)](/mtree_init/3.md), [**mtree\_free**(3)](/mtree_free/3.md), [**mtree\_build**(3)](/mtree_build/3.md), [**mtree\_child**(3)](/mtree_child/3.md)
