---
name: "memrmem"
section: "3pub"
platform: "linux"
package: "publib-dev"
version: "0.40-4"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/memrmem"
---

# memrmem(3pub)

find last occurrence of memory block within another memory block

## NAME

memrmem - find last occurrence of memory block within another memory block

## SYNOPSIS

```
#include <publib.h>
void *memrmem(const void *v, size_t size,
                const void *pat, size_t patsize);
```

## DESCRIPTION

*memrmem* finds the last occurrence of memory block *pat* within memory block *v*.

## RETURN VALUE

*memrmem* returns a pointer to the first byte of the match, if it finds any, or a null pointer if there are no matches.

## SEE ALSO

publib(3), [memmem(3)](/memmem/3.md), [strstr(3)](/strstr/3.md), strrstr(3)

## AUTHOR

Lars Wirzenius (lars.wirzenius@helsinki.fi)
