Someone
public text v1 · immutable#include <stdio.h>
#include <conio.h>
#include <string.h>
void copy(char *t,char *s, int len);
void main()
{
char source[5];
char target[5];
printf("Enter the source string\n");
scanf("%s", &source);
copy(target, source, sizeof(target));
printf("Target string =%s", target);
getch();
}
void copy(char *t, char *s, int len)
{
int count;
while(*s!='\0' && count<(len-1))
{
*t=*s;
s++;
t++;
count++;
}
*t='\0';
}