I am writing some code for a linux program I am working on that requires libssh. I was looking at their tutorial page and I saw that it passes all the parameters to ssh_options_set()
by reference. Why is that?
#include <libssh/libssh.h>
#include <stdlib.h>
int main()
{
ssh_session my_ssh_session;
int verbosity = SSH_LOG_PROTOCOL;
int port = 22;
my_ssh_session = ssh_new();
if (my_ssh_session == NULL)
exit(-1);
ssh_options_set(my_ssh_session, SSH_OPTIONS_HOST, "localhost");
ssh_options_set(my_ssh_session, SSH_OPTIONS_LOG_VERBOSITY, &verbosity); //here
ssh_options_set(my_ssh_session, SSH_OPTIONS_PORT, &port); //here
...
ssh_free(my_ssh_session);
}