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

# memmem(3pub)

search for memory block inside another memory block

## NAME

memmem - search for memory block inside another memory block

## SYNOPSIS

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

## DESCRIPTION

*memmem* searches for the pattern *pat* (length *patsize* bytes) in the memory block *v* (length *size* bytes).

## RETURN VALUE

*memmem* returns a pointer to the first byte of the first occurrence it finds, or NULL if it doesn't find any occurrence.

## SEE ALSO

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

## AUTHOR

Lars Wirzenius (lars.wirzenius@helsinki.fi)
