# _CP_in

_CP_in is equivalent to the `in *result* for *expression*` BASIC statement.

## Syntax

```
int _CP_in(int* result, int expression)
```

## Description

If no for clause is used, the user should pass -1 in *expression*. This function returns -1 if an error occurs. The error code is
contained in _CP_errno. If the time out occurs, _CP_errno contains PE_TMOUT.

Note: The environment must be set to _CP_pick_env() for _CP_in() to work properly.

## Example(s)

```
/* Gets 1 character of input. */

int i;

_CP_in(&i,-1);
_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-in/ - part of the D3Codex reference.
