/* File: copy2.c Use string library copy function This version is unsafe! */ #include #include #include #include #define MAXLENGTH 12 int main() { char another[MAXLENGTH] = "Hello World" ; char *ptr, str[MAXLENGTH] ; ptr = readline("Enter string: ") ; printf("Length of string = %d\n", strlen(ptr) ) ; strcpy(str, ptr) ; printf("Copy of string here: %s\n", str) ; printf("Another string: %s\n", another) ; free(ptr) ; return 0 ; }