# PetscStrncpy

Copies a string up to a certain length

### Synopsis

    #include "petsc.h"
    PetscErrorCode PETSC_DLLEXPORT PetscStrncpy(char s[],const char t[],size_t n)

Not Collective

### Input Parameters

| t | - pointer to string
| n | - the length to copy

### Output Parameter

s -the copied string

### Note

Null string returns a string starting with zero

### See Also

PetscStrcpy(), PetscStrcat(), PetscStrncat()

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