4 ms·
In Java, it's src array, src offset, dest array, dest offset, length. It's a natural order of from, to. It's C memcpy() that's the odd one out by putting the d
by nayuki 3y ago
In Java, it's src array, src offset, dest array, dest offset, length. It's a natural order of from, to.
It's C memcpy() that's the odd one out by putting the destination before the source.
- thwarted 3y agomemcpy argument order matches the left-to-right arrangement of assignment. lhs=rhs is rhs is copied to lhs. memcpy(lhs,rhs) is the contents at rhs is copied to lhs.
- tom_ 3y agoBritish people generally don't, but Americans very often use "to...from".
- nisse72 3y agoThey do, and it's jarring! Even though I find memcpy and friends to be perfectly logical using the assignment analogy suggested by thwarted, I often need to re-read english sentences written that way.