- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCopyString.c
More file actions
Latest commit
24 lines (24 loc) · 452 Bytes
/
Copy pathCopyString.c
File metadata and controls
24 lines (24 loc) · 452 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
//Copy a string to other string.
#include<stdio.h>
#include<string.h>
voidmystrcpy(charb[],chara[])
{
inti;
intlen=strlen(a);
for (i=0; i <= len; i++)
{
b[i] =a[i];
}
b[i] ='\0';
}
intmain()
{
chara[100], b[100];
charc;
inti, j=0, count;
printf("Enter string:\n");
gets(a);
mystrcpy(b,a);
printf("After copying string to B the string is:%s", b);
return0;
}