:orphan:
# PetscStrcmp
Compares two strings 
## Synopsis
```
static inline PetscErrorCode PetscStrcmp(const char a[], const char b[], PetscBool *flg)
```
Not Collective, No Fortran Support


## Input Parameters

- ***a -*** pointer to string first string
- ***b -*** pointer to second string



## Output Parameter

- ***flg -*** `PETSC_TRUE` if the two strings are equal





## See Also
 `PetscStrgrt()`, `PetscStrncmp()`, `PetscStrcasecmp()`

## Level
intermediate

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/include/petscstring.h.html#PetscStrcmp">include/petscstring.h</A>

## Examples
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/ksp/tutorials/ex43.c.html">src/ksp/ksp/tutorials/ex43.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/ksp/tutorials/ex72.c.html">src/ksp/ksp/tutorials/ex72.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/ksp/tutorials/ex76.c.html">src/ksp/ksp/tutorials/ex76.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/ksp/tutorials/ex77.c.html">src/ksp/ksp/tutorials/ex77.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/ksp/tutorials/ex78.c.html">src/ksp/ksp/tutorials/ex78.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/sys/tutorials/ex20.c.html">src/sys/tutorials/ex20.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ts/tutorials/ex11.c.html">src/ts/tutorials/ex11.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ts/tutorials/ex11_sa.c.html">src/ts/tutorials/ex11_sa.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/vec/is/sf/tutorials/ex1.c.html">src/vec/is/sf/tutorials/ex1.c</A><BR>


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


[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)  
