# PetscObjectObjectTypeCompare
Determines whether two PETSc objects are of the same type 
## Synopsis
```
#include "petscsys.h"    
PetscErrorCode PetscObjectObjectTypeCompare(PetscObject obj1, PetscObject obj2, PetscBool *same)
```
Logically Collective


## Input Parameters

- ***obj1 -*** any PETSc object, for example a Vec, Mat or KSP.
- ***obj2 -*** anther PETSc object



## Output Parameter

- ***same -*** PETSC_TRUE if they are the same, else PETSC_FALSE





## See Also
 `PetscObjectTypeCompare()`, `VecGetType()`, `KSPGetType()`, `PCGetType()`, `SNESGetType()`, `PetscObjectBaseTypeCompare()`, `PetscObjectTypeCompareAny()`, `PetscObjectBaseTypeCompareAny()`


## Level
intermediate

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/sys/objects/destroy.c.html#PetscObjectObjectTypeCompare">src/sys/objects/destroy.c</A>


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


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