*tmp++=*src++;

阅读 58

2023-06-16


// 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)

0 0 举报