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

C/C++ API Documentation | 2026.1

# ClientApi::SetClient( const char * )

Sets the client setting to be used for this connection.

Virtual? | No |
Class | `ClientApi` |
Arguments | `const char *c` | the new client setting
Returns | `void` |

## Notes

`SetClient()` does not permanently set the `P4CLIENT` value in the environment or registry. The new setting applies only to commands executed by calling this `ClientApi` object’s `Run()` method.

## Example

The following example displays two client specifications by calling `SetClient()` between `Run()` commands.

    ClientApi client;
    ClientUser ui;

    char *args[1];
    args[0] = "-o";

    client.SetClient( "client_one" );
    client.SetArgv( 1, args );
    client.Run( "client", &ui );

    client.SetClient( "client_two" );
    client.SetArgv( 1, args );
    client.Run( "client", &ui );

Your search for returned results