#include     //printf
#include //ssert
#include //malloc
#include //strlen char * sstrcpy(char * strdst, char * strsrc)
{
char *dst = strdst;
assert(strdst!=NULL && strsrc!=NULL);
while((*strdst++ = *strsrc++)!= '\0')
NULL;
return dst; //实现链式表达式
} //int num = strlen(strcpy(strdst,"hello world")); int main(void)
{
int num;
char *strdst = (char *)malloc(sizeof(char)*); if(strdst == NULL)
return (-);
num = strlen(sstrcpy(strdst,"hello world"));
printf("%d\n", num); return ;
}
05-25 17:16