Creating your own strcat()
void main()
{
char source[]="Folks!";
char target[30]="Hello";
scat(target,source);
printf("\nSource string = %s",source);
printf("\nTarget string = %s",target);
}
scat(char *m,char *n)
{
char *p;
p=m;
while(*n!='\0')
{
if(*m=='\0'||m>p+6)
{
*m=*n;
n++;
}
m++;
}
*m='\0';
}
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment