
本文共 1843 字,大约阅读时间需要 6 分钟。
���������������������������������������
������������������������������������
������������������������������������������ int myStrLen(char *s) { int len = 0 for (i=0; s[i] != '\0'; i++) { len++ } return len }
���������������������������������2������������������1������ void myStrConcat(char *str1, char *str2) { char *tmp = str1 while (*str1 != '\0') { str1++ } while ((*str1++ = *str2++) != '\0') {
}return tmp
}
���������������
������������������n a b������ ������������n���������assing���k��������� ������������n������������������������s��������� ������a���b��������������������������������� ������������������������������������
������������ ������n a b
������k������ allocated size 15 ������s������ allocated size 10x50
��������������������� if a != b���������myStrConcat���������s[b]���������s[a]������ ���������s[a]���������fu���������������������
������������ ������������������������������k ���������������������������
������������
string length function string concat function
main function logic
������������n a b k���������s������
��������������� default ������������
������������ ��������������������������� ������������������������
������������ ������������k���s������������������������ ���������������������������������������
������������������������������
������������������������������s[a] ��������������������������������������������� ������������������������������
���������������
������ ������������������������n a b ������������n��������� ������������n������������
������������ ��������������������������������������������������� ���������������������������������������n������������������������ ���������n���������������������������
������������ ��������������������������� ������������������������
������������������ ������������������������������ ������������������������������ ������������������������
������������������
发表评论
最新留言
关于作者
