---
name: "VistaIONewString"
section: "3"
platform: "linux"
package: "libvistaio-dev"
version: "1.2.19-3+b2"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/VistaIONewString"
---

# VistaIONewString(3)

allocate a copy of a string

## NAME

VistaIONewString - allocate a copy of a string

## SYNOPSIS

```
#include <vistaio.h>
```

```
VistaIOString VistaIONewString (string)
VistaIOString string;
```

## ARGUMENTS

- *string*

  *Specifies a null-terminated string.*

## DESCRIPTION

**VistaIONewString** *copies a string into a newly-allocated block of memory,* *which it obtains using* **VistaIOMalloc***(3). It is a convenience macro that* *calls* **VistaIOMalloc***(3) with the following arguments specified:*

```
(strcpy (VistaIOMalloc (strlen (string) + 1), string))
```

## RETURN VALUES

**VistaIONewString** *returns a pointer to the new copy of the string.*

## SEE ALSO

[**VistaIOMalloc**(3)](/VistaIOMalloc/3.md), [**VistaIONew**(3)](/VistaIONew/3.md), [**VistaIOError**(3)](/VistaIOError/3.md),

## DIAGNOSTICS

*If there is insufficient memory to allocate the new block,* **VistaIONewString** *terminates by calling* **VistaIOError***(3) with the message \`\`Out of memory''.*

## AUTHOR

*Art Pope \<pope@cs.ubc.ca\>*

*Adaption to vistaio: Gert Wollny \<gw.fossdev@gmail.com\>*

## ACKNOWLEDGMENT

*This macro and this manual page are based on similar ones* *included in the X Toolkit Intrinsics, which is*  *Copyright 1985, 1986, 1987, 1988* *Massachusetts Institute of Technology, Cambridge, Massachusetts,* *and Digital Equipment Corporation, Maynard, Massachusetts.*
