What is the difference between memcpy() and strcpy()? I tried to find it with the help of a program but both are giving the same output.
strcpy terminates when the source string's null terminator is found. memcpy requires a size parameter be passed. In the case you presented the printf statement is halting after the null terminator is found for both character arrays, however you will find t[3] and t[4] have copied data in them as well.