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

C/C++ API Documentation | 2025.1

# StrDict::SetArgv( int, char *const * )

Set a list of values, such as the arguments to a P4 Server command.

Virtual? | No |
Class | `StrDict` |
Arguments | `int argc` | the number of variables (arguments)
| `char *const *argv` | the variables (arguments) themselves
Returns | `void` |

## Notes

`SetArgv()` is typically used when setting command arguments in `ClientApi`.

## Example

`p4api.cc` provides an example of using `SetArgv()` to set arguments.

    int main( int argc, char **argv )
    {
        ClientUser ui;
        ClientApi client;
        Error e;

        // Any special protocol mods
        // client.SetProtocol( "tag", "" );

        // Connect to server
        client.Init( &e );

        // Run the command "argv[1] argv[2...]"
        client.SetArgv( argc - 2, argv + 2 );
        client.Run( argv[1], &ui );

        // Close connection
        client.Final( &e );

        return 0;
    }

Your search for returned results