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

C/C++ API Documentation | 2025.1

# ClientApi::GetConfig()

Get current configuration file.

Virtual? | No |
Class | `ClientApi` |
Arguments | None |
Returns | `const StrPtr &` | a reference to the config file setting

## Notes

See `GetClient()` for more about the `StrPtr` return value.

If the `P4CONFIG` has not been set, `GetConfig()` returns “noconfig”.

## Example

The following example demonstrates the usage of `GetConfig()`.

    ClientApi client;

    printf( "Current P4CONFIG is %s\n", client.GetConfig().Text() );

Executing the preceding code without having specified a configuration file produces the following output:

    C:\perforce> a.out
    Current P4CONFIG is noconfig

Your search for returned results