0
点赞
收藏
分享

微信扫一扫

*tmp++=*src++;

鲤鱼打个滚 2023-06-16 阅读 58


// starPtrPP.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"

char *cpystr(char* dst, const char* src)
{
	char* tmp=dst;
	while(*src!='\0')
		*tmp++=*src++;
	*tmp='\0';
	return dst;

}
int main(int argc, char* argv[])
{
	char *str="Hello World";
	char buff[256];

	printf("%s!\n",cpystr(buff,str));
	return 0;
}
/*
Hello World!
Press any key to continue
*/



举报

相关推荐

0 条评论