Skip to content

Commit 3815ae6

Browse files
committed
task 9
1 parent b2819d6 commit 3815ae6

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#include "main.h"
2+
3+
/**
4+
* char *_strcpy - a function that copies the string pointed to by src
5+
* @dest: copy to
6+
* @src: copy from
7+
* Return: string
8+
*/
9+
char *_strcpy(char *dest, char *src)
10+
{
11+
int l = 0;
12+
int x = 0;
13+
14+
while (*(src + l) != '\0')
15+
{
16+
l++;
17+
}
18+
for ( ; x < l ; x++)
19+
{
20+
dest[x] = src[x];
21+
}
22+
dest[l] = '\0';
23+
return (dest);
24+
}

0 commit comments

Comments
 (0)