Helix Core is now P4. Product user interfaces will be updated soon. Learn more >>

C/C++ API Documentation | 2025.1

# ClientUser::OutputText( const char *, int )

Output textual data.

Virtual? | Yes |
Class | `ClientUser` |
Arguments | `const char *errBuf` | the block of text to be printed
| `int length` | the length of the data
Returns | `void` |

## Notes

The most common usage of `OutputText()` is in running `p4 print` on a text file.

## Example

    > p4 print -q file.txt
    This is a text file.
    It is called "file.txt"

The arguments to `OutputText()` in the preceding example are the pointer to the first character in the file contents, and the length of the file in bytes.

To alter the way in which `OutputText()` handles text data, create a subclass of `ClientUser` and provide an alternate implementation of `OutputText()`.

For example, suppose that your `ClientUser` subclass contains a `StrBuf` called `myData`, and you want to store the data in this `StrBuf` rather than dump it to `stdout`.

    void MyClientUser::OutputText( const char *data, int length )
    {
        myData.Set( data, length );
    }

Your search for returned results