char *p="<job>programmer </job>";
char *buf="<job>";
char *pwd="assistant";
//替换programmer为assistant,保留programmer后面的空格
for(;*p != '\0';p++)
{
if(strncmp(p,buf,strlen(buf)) == 0)
{
p += strlen(buf);
for(;*pwd != '\0';p++,pwd++)
*p = *pwd;
for(;*p != '<';p++)
*p = ' ';
break;
}
}