【3D技术宅公社】XR数字艺术论坛  XR技术讨论 XR互动电影 定格动画

 找回密码
 立即注册

QQ登录

只需一步,快速开始

调查问卷
论坛即将给大家带来全新的技术服务,面向三围图形学、游戏、动画的全新服务论坛升级为UTF8版本后,中文用户名和用户密码中有中文的都无法登陆,请发邮件到324007255(at)QQ.com联系手动修改密码

3D技术论坛将以计算机图形学为核心,面向教育 推出国内的三维教育引擎该项目在持续研发当中,感谢大家的关注。

查看: 3203|回复: 0

[转帖]自己实现strcpy()

[复制链接]
发表于 2008-3-4 14:15:34 | 显示全部楼层 |阅读模式
/*
10 * Note : The user must be sure the destination string of the
11 * mystrcpy() is large enough, if the space is not large
12 * enough, then anything might happen.
13 */
14 #include <stdio.h>
15 #include <string.h>
16
17 char *mystrcpy(char *dest, char const *src)
18 {
19 char *ptr = dest; /*declare a template pointer point to dest position*/
20
21
22 if (dest == NULL || src == NULL) { /*if the dest or src NULL error!*/
23 printf("the argument is error !\n");
24 return NULL;
25 }
26
27 while (*dest++ = *src++) /*copy src to dest*/
28 ;
29
30 return ptr;
[此贴子已经被作者于2008-11-13 16:12:52编辑过]
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|3D数字艺术论坛 ( 沪ICP备14023054号 )

GMT+8, 2025-5-6 17:26

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表