Since you are new, suquan629, I'll offer a couple of pointers (no pun intended):
- You don't need to memset the array to 0 since you've allocated it to be exactly as long as you need
- Since this is a learning exercise, don't use strcpy(), instead use a loop (which is what strcpy() does internally anyway)
- Please don't solve users' problems for them. There are always people posting essentially "do my homework for me" in the guise of a question. Instead, provide hints that allow them to solve their problems themselves.