Without using realloc it is impossible to do the task in the frames of the C Standard. There is nothing complicated in using realloc.
Here is a demonstrative program that shows how it can be done
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define HELLO_WORLD "Hello World"
int main( void )
{
char *s;
size_t n = sizeof( HELLO_WORLD );
s = malloc( n );
strcpy( s, HELLO_WORLD );
puts( s );
memmove( s, s + 6, n - 6 );
puts( s );
char *t = realloc( s, n - 6 );
if ( t ) s = t;
puts( s );
free( s );
}
The program output is
Hello World
World
World
Another approach is to copy simply the substring in another allocated string. For example
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define HELLO_WORLD "Hello World"
int main( void )
{
char *s;
size_t n = sizeof( HELLO_WORLD );
s = malloc( n );
strcpy( s, HELLO_WORLD );
puts( s );
do
{
char *t = malloc( n - 6 );
if ( t )
{
strcpy( t, s + 6 );
free( s );
s = t;
}
} while( 0 );
puts( s );
free( s );
}
The program output is
Hello World
World