DIPlib Documentation - ©1995-2015 Quantitative Imaging Group, Delft University of Technology.

# StringNew

Allocate a string

## SYNOPSIS

`#include "dip_string.h"`

dip_Error dip_StringNew ( string, size, init, resources )

## FUNCTION

This function allocates a string of size `size`. If `init` is not zero, its contents is copied into the new string. If `size` is zero, and `init` is not, the size of `string` is made equal to `init` plus one.

## ARGUMENTS

Data type | Name | Description
`dip_String *` | `string` | Pointer to the new string
`dip_int` | `size` | Size of the string
`char *` | `init` | Initialisation string
`dip_Resources` | `resources` | Resources tracking structure. See `ResourcesNew`

## SEE ALSO

`StringArrayNew`, `StringAppend`, `StringCat`, `StringCompare`, `StringCompareCaseInsensitive`, `StringCopy`, `StringCrop`, `StringReplace`, `UnderscoreSpaces`