Tutorial code sample 1

Instantiation and destruction.
This is the base code to instantiate and destroy a client or a server, along with some simple user input.

    #include < stdio.h > // Printf and gets
    #include "RakClientInterface.h"
    #include "RakNetworkFactory.h"
    #include "RakServerInterface.h"

    int main(void)
    {
    	char str[512];
    	RakClientInterface *rakClientInterface;
    	RakServerInterface *rakServerInterface;

    	printf("(C)lient or (S)erver?\n");
    	gets(str);
    	if (str[0]=='c')
    	{
    		rakClientInterface=RakNetworkFactory::GetRakClientInterface();
    		rakServerInterface=0;
    	}
    	else
    	{
    		rakClientInterface=0;
    		rakServerInterface=RakNetworkFactory::GetRakServerInterface();
    	}

    	// TODO - Add code body here

    	if (rakClientInterface)
    		RakNetworkFactory::DestroyRakClientInterface(rakClientInterface);
    	else if (rakServerInterface)
    		RakNetworkFactory::DestroyRakServerInterface(rakServerInterface);
    	return 0;
    }