ITeye博客

C语言_字符串指针学习笔记1

rafale35 · 2010-10-24 17:12 · C语言基础 · 编程语言 · Markdown

strcpy(s, t)
	char s[], t[]; {
	int i;
	i = 0;
	while ((s[i] = t[i]) != '\o')
		i++;
}

strcpy(s, t)
	char *s, *t; {
	while ((*s = *t) != '\0') {
		s++;
		t++;
	}
}
strcpy(s, t)
	char *s, *t; {
	while ((*s++ = *t++) != '\0')
		;
}

strcpy(s, t)
	char *s, *t; {
	while ((*s++ = *t++))
		;
}

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。