# _CP_col2

_CP_col2 is equivalent to the `*result* = col2` BASIC statement.

## Syntax

```
int _CP_col2(int* result)
```

## Description

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

## Example(s)

```
/* Prints "ab 2 5" */

CPSTR * s = _CP_mkstr("zdabdz");
CPSTR * t = _CP_mkstr("d");
int i,j;

_CP_field(&s,s,t,2);
_CP_col2(&i);
_CP_col2(&j);
_CP_TERM(s);
_CP_unix_env();
printf("%s %d %d\n",_CP_SADDR(s),i,j);
```

## See also

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

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