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

# XmStringComponentCreate(3)

A compound string function that creates arbitrary components

## NAME

**XmStringComponentCreate** — A compound string function that creates arbitrary components

## SYNOPSIS

```
#include <Xm/Xm.h>
XmString XmStringComponentCreate(
XmStringComponentType c_type,
unsigned int length,
XtPointer value);
```

## DESCRIPTION

**XmStringComponentCreate** creates a new **XmString** component of type *c\_type*, containing *value*. If *value* is invalid for the particular component type, this function fails and returns NULL.

- *c\_type*

  Specifies the type of component to be created.

- *length*

  Specifies the length in bytes of *value*. Note that this must be precisely the length of the *value* string, *not* including any trailing null characters.

- *value*

  Specifies the value to be used in the creation of the component.

Refer to the [**XmStringComponentType**(3)](/XmStringComponentType/3.md) reference page for a list of the possible **XmString** component types.

## RETURN

If *value* is invalid for *c\_type*, fails and returns NULL. Otherwise, this function returns a new compound string. When the application no longer needs the returned compound string, the application should call **XmStringFree**.

## RELATED

[**XmString**(3)](/XmString/3.md), **XmStringGetNextTriple**, **XmStringComponentType**, and [**XmStringFree**(3)](/XmStringFree/3.md).
