The first example memcpy() code is semi-broken since it uses an int-type iterator variable which is compared against a size_t-type length. This would generate warnings from most compilers (signed vs unsigned) and is generally a bad idea, the iterator should of course have been size_t too.
Also there could have been more const, but that's almost always true. :)