# VecGetType
Gets the vector type name (as a string) from the Vec. 
## Synopsis
```
#include "petscvec.h"  
PetscErrorCode VecGetType(Vec vec, VecType *type)
```
Not Collective


## Input Parameter

- ***vec  -*** The vector



## Output Parameter

- ***type -*** The vector type name





## See Also
 `VecSetType()`, `VecCreate()`

## Level
intermediate

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/vec/vec/interface/vecreg.c.html#VecGetType">src/vec/vec/interface/vecreg.c</A>

## Examples
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/vec/vec/tutorials/ex1f.F90.html">src/vec/vec/tutorials/ex1f.F90.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/ksp/tutorials/ex73.c.html">src/ksp/ksp/tutorials/ex73.c.html</A><BR>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/vec/vec/interface/vecreg.c)


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