# _CP_convert

_CP_convert is equivalent to the `convert *string1* to *string2*` in result BASIC statement.

## Syntax

```
int _CP_convert(CPSTR** result, CPSTR* string1, CPSTR* string2)
```

## Description

This function returns -1 if
an error occurs. The error code is contained in _CP_errno.

## Example(s)

```
/* Prints "bbc". */

CPSTR * s = _CP_mkstr("a");
CPSTR * t = _CP_mkstr("b");
CPSTR * u = _CP_mkstr("abc");

_CP_unix_env();
_CP_convert(&u,s,t);
_CP_TERM(u);
printf("%s\n",_CP_SADDR(u));
```

## See also

- [C functions overview](https://d3codex.com/cfunctions/c-functions-overview/)

---
Source: https://d3codex.com/cfunctions/cp-convert/ - part of the D3Codex reference.
