# _CP_num

_CP_num is equivalent to the `*result* = num(*string*)` BASIC function.

## Syntax

```
int _CP_num(int* result, CPSTR* string)
```

## Description

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

## Example(s)

```
/* is "1" alphabetic? */

CPSTR * s = _CP_mkstr("1");
int i;

_CP_num(&i,s);
_CP_unix_env();
printf("%d\n", i);
```

## See also

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

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