Вот небольшой фрагмент кода, который может помочь:
char array1[5] = "test", array2[5];
int length = 5;
memcpy(array2, array1, length*sizeof(char));
//the sizeof() is redundant in this because each char is a byte long
//but it is useful if you are working with other datatypes
memcpy, вероятно, станет вашим лучшим другом в подобных ситуациях.