Or, instead of getting overly complicated, you could use strstr:
char *strstr( const char *string, const char *strCharSet );
Example from help files:
Code:
#include <string.h>
#include <stdio.h>
char str[] = "lazy";
char string[] = "The quick brown dog jumps over the lazy fox";
char fmt1[] = " 1 2 3 4 5";
char fmt2[] = "12345678901234567890123456789012345678901234567890";
void main( void )
{
char *pdest;
int result;
printf( "String to be searched:\n\t%s\n", string );
printf( "\t%s\n\t%s\n\n", fmt1, fmt2 );
pdest = strstr( string, str );
result = pdest - string + 1;
if( pdest != NULL )
printf( "%s found at position %d\n\n", str, result );
else
printf( "%s not found\n", str );
}
Then just copy the string from before the located word, strcat "me" instead of "you", then strcat the remainder of the string.
Loop up: strstr, strncpy, strncat.
strncpy and strncat will copy/append n bytes of your string, which is what you'll need to be doing.