---
title: "c语言实现字符串拷贝"
author: "lesorb"
date: "2010-10-16T15:31:13Z"
tags: []
categories: ["编程语言"]
slug: "c"
draft: false
lastmod: "2010-10-16T15:31:13Z"
id: 786360
url: "https://lesorb.iteye.com/blog/786360"
---

c语言实现字符串拷贝，如下：

```c
void myStrcpy(char *target,char *source)
{
	while((*target = *source) != '\0')
	{
		target++;
		source++;
	}
}
```

注意声明函数定义：void myStrcpy(char *target,char *source);