/* Program to copy one string to another string using pointer function */ /* Problem 31 */ #include #include void cpystr(char *ptr2, char *ptr1) { while (*ptr1) *ptr2++ = *ptr1++; } main() { char str1[20],str2[20] = {'\0'}; int len; clrscr(); printf("Please enter the first string : "); scanf("%s",str1); cpystr(str2,str1); printf("\nThe another string is now : %s",str2); printf("\n\nPress any key to exit..."); getch(); }