/*字符串的拼接,将s2拼接到搜s1的后边*/
# include <stdio.h>
int main ()
{ char s1[1024] = "" ;
char s2[1024] = "" ;
printf ("pleade input strings for s1\n s1 = ") ;
scanf ("%s",s1);
printf ("pleade input strings for s2\n s2 = ") ;
scanf ("%s",s2);
printf ("s1=%s\n",s1);
printf ("s2=%s\n",s2);
int len1 , len2 ;
int i , j ;
for (i=0 ; s1[i] ; i++);
len1 = i ;
#ifdef DEBUG
printf ("len1=%d\n",len1);
#endif
for(j=0;s2[j];j++)
s1[i++] = s2[j] ; //只需将s1长度求出即可,s2顺序放置其后
printf ("\nafter joint\n\n") ;
printf ("s1= %s\n",s1) ;
printf ("s2 = %s\n",s2) ;
return 0 ;
}