:orphan:
# PetscViewerStringOpen
Opens a string as a `PETSCVIEWERSTRING` `PetscViewer`. This is a very simple `PetscViewer`; information on the object is simply stored into the string in a fairly nice way. 
## Synopsis
```
#include "petscsys.h"  
PetscErrorCode PetscViewerStringOpen(MPI_Comm comm, char string[], size_t len, PetscViewer *lab)
```
Collective; No Fortran Support


## Input Parameters

- ***comm -*** the communicator
- ***string -*** the string to use
- ***len    -*** the string length



## Output Parameter

- ***lab -*** the `PetscViewer`





## See Also
 [](sec_viewers), `PETSCVIEWERSTRING`, `PetscViewerDestroy()`, `PetscViewerStringSPrintf()`, `PetscViewerStringGetStringRead()`, `PetscViewerStringSetString()`

## Level
advanced

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/sys/classes/viewer/impls/string/stringv.c.html#PetscViewerStringOpen">src/sys/classes/viewer/impls/string/stringv.c</A>

## Examples
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/ksp/tutorials/ex72.c.html">src/ksp/ksp/tutorials/ex72.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ts/tutorials/ex3.c.html">src/ts/tutorials/ex3.c</A><BR>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/sys/classes/viewer/impls/string/stringv.c)


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