# PetscArraycmp
Compares two arrays in memory. 
## Synopsis
```
#include <petscsys.h>
PetscErrorCode PetscArraycmp(const anytype *str1,const anytype *str2,size_t cnt,PetscBool *e)
```
Not Collective


## Input Parameters

- ***str1 -*** First array
- ***str2 -*** Second array
- ***cnt  -*** Count of the array, not in bytes, but number of entries in the arrays



## Output Parameters

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





## Notes
This routine is a preferred replacement to `PetscMemcmp()`

The arrays must be of the same type


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

## Level
intermediate

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/include/petscsys.h.html#PetscArraycmp">include/petscsys.h</A>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/include/petscsys.h)


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