---
name: "rlist_nth"
section: "3"
platform: "linux"
package: "libroy-dev"
version: "1.0.8-1"
release: "Debian 3.1 (Sarge)"
platforms: ["linux"]
url: "https://new.carta.tech/rlist_nth"
---

# rlist\_nth(3)

get the nth entry in the list

## NAME

rlist\_nth - get the nth entry in the list

## SYNOPSIS

\#include \<roy.h\>

void \* rlist\_nth (RList \* *list*, unsigned int *nth*);

## DESCRIPTION

This call indexes into *list* as if it were an array of entries. Entry 1 is accessed with *nth* of 0, and the last entry is accessed with *nth* of last - 1.

## RETURN VALUE

The return type of *void \** is used so the compiler will upgrade the return value to your entry type. As long as the value isn't NULL the value should be compatable with an RListEntry pointer. See [*rlist*(3)](/rlist/3.md) on how to create RListEntry compatible entry structs.

This call returns the *nth* entry in *list* or NULL if *list* has *nth* or fewer entries.

## ERRORS

A call to [*rlist\_nth*(3)](/rlist_nth/3.md) will never fail, but will return NULL if *nth* is out of range.

## FUNCTION

The [*rlist\_nth*(3)](/rlist_nth/3.md) api is implemented using a function.

## SEE ALSO

[*rlist*(3)](/rlist/3.md), [*rlist\_append*(3)](/rlist_append/3.md),  [*rlist\_compare*(3)](/rlist_compare/3.md), [*rlist\_first*(3)](/rlist_first/3.md),  [*rlist\_free*(3)](/rlist_free/3.md), [*rlist\_last*(3)](/rlist_last/3.md),  [*rlist\_new*(3)](/rlist_new/3.md), [*rlist\_next*(3)](/rlist_next/3.md),  [*rlist\_prepend*(3)](/rlist_prepend/3.md), [*rlist\_prev*(3)](/rlist_prev/3.md),  [*rlist\_remove*(3)](/rlist_remove/3.md), [*roy*(3)](/roy/3.md)
