#include <stdio.h>
#include <ctype.h>
#include <string.h>

void DivideString( const char * txt, char * m1, char * m2 )
{
	int tam = strlen(txt);
	int meio = tam / 2;

	while( txt[meio] && !isspace(txt[meio]) )
		meio++;

	*m1 = '\0';
	*m2 = '\0';

	strncat( m1, txt, meio );
	strncat( m2, txt + meio + 1, tam - meio );
}

int main( void )
{
	char texto[] = "O rato roeu a roupa do rei de Roma.";

	char metade1[100];
	char metade2[100];

	DivideString( texto, metade1, metade2 );

	printf( "Texto: %s (Tamanho: %ld)\n", texto, strlen(texto) );
	printf( "Metade1: %s (Tamanho: %ld)\n", metade1, strlen(metade1) );
	printf( "Metade2: %s (Tamanho: %ld)\n", metade2, strlen(metade2) );

	return 0;
}