# _CP_printer

_CP_printer is equivalent to the `printer *expression*` BASIC statement.

## Syntax

```
int _CP_printer(int expression)
```

## Description

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

Note: The environment must be set to _CP_pick_env for this function to work properly.

## Example(s)

```
/* Prints "hi" to the printer.*/

CPSTR * s = _CP_mkstr("hi");

_CP_printer(1);
_CP_print(s);
_CP_printer(0);
_CP_printer(-1);
```

## See also

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

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