:orphan:
# PetscMemcmp
Compares two byte streams in memory. 
## Synopsis
```
#include "petscsys.h"   
PetscErrorCode PetscMemcmp(const void *str1, const void *str2, size_t len, PetscBool *e)
```
Not Collective


## Input Parameters

- ***str1 -*** Pointer to the first byte stream
- ***str2 -*** Pointer to the second byte stream
- ***len  -*** The length of the byte stream
(both str1 and str2 are assumed to be of length len)



## Output Parameter

- ***e -*** `PETSC_TRUE` if equal else `PETSC_FALSE`.





## Notes
`PetscArraycmp()` is preferred

This routine is analogous to `memcmp()` with additional error checking


## See Also
 `PetscMemcpy()`, `PetscMemcmp()`, `PetscArrayzero()`, `PetscMemzero()`, `PetscArraycmp()`, `PetscArraycpy()`, `PetscStrallocpy()`,
`PetscArraymove()`

## Level
intermediate

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/sys/utils/memc.c.html#PetscMemcmp">src/sys/utils/memc.c</A>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/sys/utils/memc.c)


[Index of all Sys routines](index.md)  
[Table of Contents for all manual pages](/manualpages/index.md)  
[Index of all manual pages](/manualpages/singleindex.md)  
