This problem requires the implementation of a function , Join two strings .
Function interface definition :
char *str_cat( char *s, char *t );
function str_cat String expected t Copy to string s End of , And returns a string s First address of .
Sample referee test procedure :
#include <stdio.h>
#include <string.h>
#define MAXS 10
char *str_cat( char *s, char *t );
int main()
{
char *p;
char str1[MAXS+MAXS] = {'\0'}, str2[MAXS] = {'\0'};
scanf("%s%s", str1, str2);
p = str_cat(str1, str2);
printf("%s\n%s\n", p, str1);
return 0;
}
/* Your code will be embedded here */
sample input :
abc
def
sample output :
abcdef
abcdef
char *str_cat( char *s, char *t ){ int i,j;
for(i=strlen(s),j=0;t[j]!='\0';i++,j++){ s[i]=t[j]; } return s; }
Technology