:orphan:
# PetscObjectGetOptionsPrefix
Gets the prefix of the `PetscObject` used for searching in the options database 
## Synopsis
```
#include "petscsys.h"    
PetscErrorCode PetscObjectGetOptionsPrefix(PetscObject obj, const char *prefix[])
```

## Input Parameter

- ***obj -*** any PETSc object, for example a `Vec`, `Mat` or `KSP`.



## Output Parameter

- ***prefix -*** pointer to the prefix string used is returned





## See Also
 `PetscOptionsCreate()`, `PetscOptionsDestroy()`, `PetscObjectSetOptionsPrefix()`, `PetscObjectAppendOptionsPrefix()`, `PetscObjectPrependOptionsPrefix()`,
`TSGetOptionsPrefix()`, `SNESGetOptionsPrefix()`, `KSPGetOptionsPrefix()`

## Level
advanced

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

## Examples
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/snes/tutorials/ex36.c.html">src/snes/tutorials/ex36.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ts/tutorials/ex18.c.html">src/ts/tutorials/ex18.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ts/tutorials/ex53.c.html">src/ts/tutorials/ex53.c</A><BR>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/sys/objects/prefix.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)  
