PetscStrlcat — PETSc 3.25.2 documentation

Skip to main content
`Ctrl`+`K`

# PetscStrlcat

Concatenates a string onto a given string, up to a given length

## Synopsis

    static inline PetscErrorCode PetscStrlcat(char s[], const char t[], size_t n)

Not Collective, No Fortran Support

## Input Parameters

- s - pointer to string to be added to at end

- t - string to be added

- n - length of the original allocated string

## Note

Unlike the system call `strncat()`, the length passed in is the length of the original allocated space, not the length of the left-over space. This is similar to the BSD system call `strlcat()`.

## See Also

`PetscStrncpy()`

## Level

intermediate

## Location

include/petscstring.h

## Examples

src/tao/constrained/tutorials/maros.c
src/ts/tutorials/ex18.c

Index of all Sys routines
Table of Contents for all manual pages
Index of all manual pages