自己写的strcat
程序代码:
#include <stdio.h> void strcat(char *string1, char *string2){ while(*string1 != '\0') string1++; while(*string2) { *string1++ = *string2++; } *string1++ = '\0'; } int strlen(char *string1){ int count = 0; while(*string1++ != '\0') count++; return count; } int main(void) { char name[100]="wangfeng"; char *mesg = " is a student!"; strlen(name); puts(name); return 0; }