That's the idea, but it's not quite correct yet. You are replacing the terminating null character with 'X', strcpy needs the terminating null to know how many characters to copy, so by replacing the null character you will confuse strcpy and you will read and write past the bounds of your arrays.