These homeworks are not graded. However, we strongly encourage you to do this and leave a copy in /afs/andrew/course/15/123/handin/homework/yourID 5.1 : The following code is supposed to swap two strings (char*'s) What can go wrong with the code? Assume A[i] and A[j] are strings with pre-allocated memory to hold strings s1 and s2. char tmp[50]; strcpy(tmp,A[i]); strcpy(A[i],A[j]); strcpy(A[j], tmp); Ans: Need to assume that A[i] is less than 50 characters Need to assume that A[j] is less or equal to A[i] Need to assume A[j] has at least 50 bytes assigned to it 5.2: What are some of the differences between char A[50] and char* A = malloc(50)? ANS: char A[50] allocates 50 stack bytes that can only be freed by compiler malloc(50) assigns 50 heap bytes that can be freed by programmer 5.3: write your own strcpy function. int mystrcpy(char* s1, char* s2){ int n = strlen(s2),i; for (i=0; i<=n; i++) s1[i] = s2[i]; }