#include
int strlen( char *s )
{
int slen , i ;
i = 0 ;
while( s[i] )
i ++ ;
slen = i ;
return slen ;
}
int strcat(char *s , char *t)
int slen , tlen , i , j ;
slen = strlen( s ) ;
tlen = strlen( t ) ;
for( i = slen , j = 0 ; j
s[i+j] = t[j] ;
s[i+j] = "\0" ;
return 0 ;
int main( )
char str1[15] = "abcdefg" , str2[15] = "hijklmn" ;
printf( "%s %s\n" , str1 , str2 ) ;
strcat( str1 , str2 ) ;
#include
int strlen( char *s )
{
int slen , i ;
i = 0 ;
while( s[i] )
i ++ ;
slen = i ;
return slen ;
}
int strcat(char *s , char *t)
{
int slen , tlen , i , j ;
slen = strlen( s ) ;
tlen = strlen( t ) ;
for( i = slen , j = 0 ; j
{
s[i+j] = t[j] ;
}
s[i+j] = "\0" ;
return 0 ;
}
int main( )
{
char str1[15] = "abcdefg" , str2[15] = "hijklmn" ;
printf( "%s %s\n" , str1 , str2 ) ;
strcat( str1 , str2 ) ;
printf( "%s %s\n" , str1 , str2 ) ;
return 0 ;
}