Encoders
>
More...
>
C
>
Program
/* Function strcat(s,t) to concatenate t to the end of s and return the
concatenated string, s must be big enough. (using pointers) */
#include <stdio.h>
char *strcat(char *s, char *t);
main()
{
char a[100]="hello ", b[]="world";
printf("%s\n",strcat(a,b));
}
char *strcat(char *s, char *t)
{
char *start=s;
while(*s)
s++;
while(*s++ = *t++)
;
return start;
}
|