Answering a question about order of parameters it struck me that strcpy (and family) are the wrong way round. Copy should be src -> destination.Is there a historical or architectural reason for the dest,src order in these 'C' functions? Something to do with optimization of the stack on the PDP-8 or something?
strcpy memcpy reason for parameter order
c;history
Think of it like an assignment operation.A = B;  //copies the contents of B into ASame order when using memcpy to copy an array.memcpy(A, B, sizeof(B));  //copies the contents of B into A