---
name: "XmStringNCopy"
section: "3"
platform: "linux"
package: "openmotif"
version: "2.3.8-4"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/XmStringNCopy"
---

# XmStringNCopy(3)

A compound string function that creates a copy of a compound string

## NAME

**XmStringNCopy** — A compound string function that creates a copy of a compound string

## SYNOPSIS

```
#include <Xm/Xm.h>
XmString XmStringNCopy(
XmString s1,
int num_bytes);
```

## DESCRIPTION

This function is obsolete and exists for compatibility with previous releases. **XmStringNCopy** creates a copy of *s1* that contains a specified number of bytes, including tags, directional indicators, and separators. It then returns the resulting compound string. The original strings are preserved. The function allocates space for the resulting compound string. The application is responsible for managing the allocated space. The application can recover the allocated space by calling **XmStringFree**.

- *s1*

  Specifies the compound string.

- *num\_bytes*

  Specifies the number of bytes of *s1* to copy. If this value is less than the length of *s1*, as many bytes as possible, but possibly fewer than this value, will be appended to *s1* such that the resulting string is still a valid compound string.

## RETURN

Returns a new compound string.

## RELATED

[**XmStringCreate**(3)](/XmStringCreate/3.md) and [**XmStringFree**(3)](/XmStringFree/3.md).
