C-StrCat:文字列tをsの末尾にコピーします

大きな牛の人工知能のチュートリアルを共有します。ゼロベース!わかりやすい!面白くてユーモラス!あなたも人工知能チームに参加してください!http://www.captainbed.netをクリックしてください

/*
 * StrCat: Copy the string t to the end of s.
 *
 * StrCat.c - by FreeMan
 */

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

void StrCat(char *s, char *t)
{
	while (*s)
	{
		++s;
	}
	StrCpy(s, t);
}

 

おすすめ

転載: blog.csdn.net/chimomo/article/details/114589603