# VecRestoreArrayAndMemType
Restores a vector after `VecGetArrayAndMemType()` has been called. 
## Synopsis
```
#include "petscvec.h"   
PetscErrorCode VecRestoreArrayAndMemType(Vec x, PetscScalar **a)
```
Logically Collective


## Input Parameters

- ***x -*** the vector
- ***a -*** location of pointer to array obtained from `VecGetArrayAndMemType()`





## See Also
 [](chapter_vectors), `Vec`, `VecGetArrayAndMemType()`, `VecGetArray()`, `VecRestoreArrayRead()`, `VecRestoreArrays()`, `VecRestoreArrayF90()`, `VecRestoreArrayReadF90()`,
`VecPlaceArray()`, `VecRestoreArray2d()`, `VecGetArrayPair()`, `VecRestoreArrayPair()`

## Level
beginner

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

## Implementations

<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/vec/vec/impls/seq/kokkos/veckok.kokkos.cxx.html#VecRestoreArrayAndMemType_SeqKokkos">VecRestoreArrayAndMemType_SeqKokkos in src/vec/vec/impls/seq/kokkos/veckok.kokkos.cxx</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/vec/vec/impls/seq/seqcuda/veccuda.c.html#VecRestoreArrayAndMemType_SeqCUDA">VecRestoreArrayAndMemType_SeqCUDA in src/vec/vec/impls/seq/seqcuda/veccuda.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/vec/vec/impls/seq/seqhip/vechip.hip.c.html#VecRestoreArrayAndMemType_SeqHIP">VecRestoreArrayAndMemType_SeqHIP in src/vec/vec/impls/seq/seqhip/vechip.hip.c</A><BR>


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