# PetscNew

Allocates memory of a particular type, zeros the memory!

### Input Parameter

type -structure name of space to be allocated. Memory of size sizeof(type) is allocated

### Output Parameter

result -memory allocated

### Synopsis

    PetscErrorCode PetscNew(struct type,((type *))result)

### See Also

PetscFree(), PetscMalloc()

Level:beginner
Location:include/petsc.h
Index of all Sys routines
Table of Contents for all manual pages
Index of all manual pages

### Examples

src/ksp/ksp/examples/tutorials/ex15.c.html
src/snes/examples/tutorials/ex24.c.html
src/dm/da/examples/tutorials/ex6.c.html