# PetscMemcpy

Copies n bytes, beginning at location b, to the space beginning at location a. The two memory regions CANNOT overlap, use PetscMemmove() in that case.

### Synopsis

    #include "petsc.h"
    int PetscMemcpy(void *a,const void *b,int n)

Not Collective

### Input Parameters

| b | - pointer to initial memory space
| n | - length (in bytes) of space to copy

### Output Parameter

a -pointer to copy space

### Compile Option

PETSC_PREFER_DCOPY_FOR_MEMCPY will cause the BLAS dcopy() routine to be used for memory copies on double precision values.

### Note

This routine is analogous to memcpy().

### See Also

PetscMemmove()

Level:intermediate
Location: src/sys/src/utils/memc.c
Index of all Sys routines
Table of Contents for all manual pages
Index of all manual pages

### Examples

src/dm/ao/examples/tutorials/ex2.c.html