#include <stdio.h>
#include <stdlib.h>
int main()
{
char str1[50];
char str2[50];
char str3[50];
int i=0
,j=0;
printf("please enter a sentence(str1):\n");
gets(str1);
printf("printing:\n");
puts(str1);
printf("\n");
char copy(char *p2,char *p1);
copy(str2,str1);
printf("please enter a sentence(str3):\n");
gets(str3);
while(str1[i]!='\0')i++;
while(str3[j]!='\0')
str1[i++]=str3[j++];
str1[i]='\0';str3[j]='\0';
printf("%s\n",str1);
}
char copy(char* p2,char* p1)
{
for(;*p1!='\0';p1++,p2++)
{*p2=*p1;
}*p2='\0';
printf("copy from str1:\n");
}
#include <stdlib.h>
int main()
{
char str1[50];
char str2[50];
char str3[50];
int i=0
,j=0;
printf("please enter a sentence(str1):\n");
gets(str1);
printf("printing:\n");
puts(str1);
printf("\n");
char copy(char *p2,char *p1);
copy(str2,str1);
printf("please enter a sentence(str3):\n");
gets(str3);
while(str1[i]!='\0')i++;
while(str3[j]!='\0')
str1[i++]=str3[j++];
str1[i]='\0';str3[j]='\0';
printf("%s\n",str1);
}
char copy(char* p2,char* p1)
{
for(;*p1!='\0';p1++,p2++)
{*p2=*p1;
}*p2='\0';
printf("copy from str1:\n");
}