# PetscBagGetNames
Get the names of all entries in the bag 
## Synopsis
```
#include "petscbag.h"   
PetscErrorCode PetscBagGetNames(PetscBag bag, const char *names[])
```
Not collective


## Input Parameters

- ***bag   -*** the bag of values
- ***names -*** array of the correct size to hold names, must be long enough to hold all the names



## Output Parameter

- ***names -*** array of char pointers for names





## See Also
 `PetscBag`, `PetscBagGetName()`, `PetscBagSetName()`, `PetscBagCreate()`, `PetscBagGetData()`
`PetscBagRegisterReal()`, `PetscBagRegisterInt()`, `PetscBagRegisterBool()`, `PetscBagRegisterScalar()`, `PetscBagRegisterEnum()`

## Level
intermediate

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/sys/classes/bag/bag.c.html#PetscBagGetNames">src/sys/classes/bag/bag.c</A>


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