*tmp++=*src++;

来源:互联网 发布:mac jdk降级 编辑:程序博客网 时间:2024/06/06 20:02
// 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*/

原创粉丝点击